A
ais523
I've checked the FAQ for this and couldn't find the answer. Is the
following code snippet portable?
int a[10][10];
a[1][4]=6;
printf("%d\n",(*a)[14]);
This prints "6" on my compiler. I've been told it's always legal, but
it seems slightly suspect to me. Can you really go out-of-bounds like
this on one of the 'sub-arrays' a[0], a[1], etc.?
(N.B. To the pedants out there: this is not meant to be a complete
program, just part of one.)
following code snippet portable?
int a[10][10];
a[1][4]=6;
printf("%d\n",(*a)[14]);
This prints "6" on my compiler. I've been told it's always legal, but
it seems slightly suspect to me. Can you really go out-of-bounds like
this on one of the 'sub-arrays' a[0], a[1], etc.?
(N.B. To the pedants out there: this is not meant to be a complete
program, just part of one.)