/** * This simple program takes a single command line argument, * converts it to an integer, and then goes into an infinite * loop printing out the integer and its address in memory. * * Run this program simultaneously in several different terminals. * What do you notice about the value of "myval"? What do you notice * about the address of myval? * * What does this imply about memory space in two different processes, * even for the same program? */ #include int myval; int main(int argc, char *argv[]) { if (argc < 2) exit(1); myval = atoi(argv[1]); while (1) printf("myval == %d, &myval == 0x%lx\n", myval, (long) &myval); }