Re:Conflating pointers with arrays: C's biggest mistake? (2009)
by jibal on Monday July 23, 2018 @06:11AM
(#17591700)
He said "array type". There isn't one in C.
"It's just that arrays become pointers when passed between functions"
Oh, is that all?
Did you read the article, or the comment you're responding to? They point out the cost of "just" doing that.
C arrays know their length, it's always `sizeof(arr) / sizeof(*arr)`. It's just that arrays become pointers when passed between functions, and dynamically-sized regions (what is an array in most other languages) are always accessed via a pointer.