
Thomas Davie
I'm not familiar with your C++ example (not being familiar with C++), but I think that it's a bit of a stretch of the imagination to say that C "introduces a variable of type "array of 50 ints"", the fact that this is now an array of 50 integers is never checked at any point in the compilation or run, and I'm not sure it can be even if K&R had wanted to.
The size is taken into account when such array type is an element of another array, and by sizeof. int (*p)[50]; /* p may legally point only to arrays of 50 ints each */ ++p; /* p is assumed to point into an array, and is moved by one element, i.e. by 50 ints */
As an example:
int bobsArray[5]; bobsArray[6] = 23;
is not badly typed - it is merely a badly broken program.
Because the array size is not taken into account by indexing. But it's a part of the type. These issues are independent, for example in C# both are the opposite. -- __("< Marcin Kowalczyk \__/ qrczak@knm.org.pl ^^ http://qrnik.knm.org.pl/~qrczak/