Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

What does this program print?

Name: Anonymous 2011-10-18 14:55


#include <stdio.h>
int main() {
  int x[5];
  printf("%p\n", x);
  printf("%p\n", x+1);
  printf("%p\n", &x);
  printf("%p\n", &x+1);
  return 0;
}


Since none of you use C compilers I know there will be no risk of cheating.

Name: Anonymous 2011-10-20 0:57

>>31
Yes, but I mean is &x+1 really guaranteed to point immediately after the end of x? Isn't it allowed for there to be padding after x to allow x+1 to be aligned? Is it even guaranteed that x+1 won't be temporarily stored somewhere totally different in memory, separate from the stack?

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List