You can find out where the various segments of memory reside
by creating variables in each segment and printing their addresses.
To get the address of a variable, use the & operator.
For example,
int i;
printf ("0x%x\n", &i);
creates a local variable named i and prints its
address in hexadecimal (the 0x prefix is the standard way to indicate
that a number is hexadecimal).