Originally Posted by
Elysia
Because beginners make mistakes. Like not passing in the proper correct size.
It also lessens the need to manually pass in the size (which is errorprone) and have the compiler handle that job. We always want the compiler to handle as much stuff as possible.
I'm not sure I understand. With respect to fixed size arrays:
Code:
const size_t mysize = sizeof somethings / sizeof somethings[0];
/* or... */
foo(somethings, sizeof somethings / sizeof somethings[0]);
The compiler handles this code too, and I made it so it cannot be changed.
Is the template really even necessary?