David Brown <
david.brown@hesbynett.no> writes:
On 17/07/2024 15:42, Bart wrote:
On 13/07/2024 10:37, David Brown wrote:
[Arrays in C]
Somebody could have done the same exercise with gcc, and come to the
same conclusion: too many programs use array parameters.
Did it never occur to you that most people use array parameters
/correctly/ ? Some people don't like using them (I'm not a big fan
myself), but other people like them.
Most of the time (90%), I walk through arrays with *ptr++,
which seems a perfectly cromulent way to walk through a C-style
array in C or C++. Since C-style arrays don't have a descriptor
which defines the size, which can be passed with the pointer implicitly,
there is no point in passing an array by Bart's interpretation
of 'reference'. Passing a pointer either explicitly or implicitly
and a separate array size has been, and is, the normal paradigm.
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)