Hacker News new | ask | show | jobs
by w0000t 3955 days ago
What!? Size of the array is always known to the programmer in C. In fact, if the programmer wants to get rid of that information, he/she must deliberately do so. Once one does that, the array becomes useless.

You also haven't explained how would that size information, which we already have, magically solve the problem.

1 comments

A large part of overflows come from querying an array beyond its size. If the size of the array was already contained in the array (think of C# arrays which always have a Length property), developers could build more robust code that wouldn't rely on the size of the array being inferred from some other parts of the code.