x + sizeof x / sizeof *x
(foo *)((char *)x + sizeof x)
x + sizeof x
(foo *)((char *)x + sizeof (foo) * sizeof x))
&x + 1
As to your final question: Parameter declarations discard the size of array types - they are actually pointer-declarations in disguise.
To enforce a fixed array size, you need to declare a parameter of type pointer-to-array, eg
void bar(int (*arg)[42]);
int x[42] = { 0 }; bar(&x);
*(&x + 1)
As to your final question: Parameter declarations discard the size of array types - they are actually pointer-declarations in disguise.
To enforce a fixed array size, you need to declare a parameter of type pointer-to-array, eg
which you'd have to call like this: