News for hackers. Stuff that matters.
Re:Conflating pointers with arrays: C's biggest mistake? (2009) by bluetomcat on Sunday July 22, 2018 @03:35AM (#17585685)
> Adding an array type to C that knows its own length would solve so many headaches

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.

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.