W
Wojtek Lerch
pete said:int the_array[2][2];
I'm considering the_array as a single object,
which is four times the size of int and also aligned for type int.
Yes, that's what it is.
I would figure that I could increment a pointer to int
through any object that was aligned for type int and big enough.
You can on most implementations, but the standard doesn't guarantee that.
The range of values you're allowed to add to a pointer is defined in terms
of the array whose element the pointer points to, not in terms of the size
of the whole object that that array belongs to. If you could add three to
the_array[0], the result would point to the_array[1][1], but you can't.