I am reading some text about the C language at the url https://cs.senecac.on.ca/~btp100/pages/content/compu.html. In the section “Segmentation”, it says:
“One logical technique for managing the addressing of a large number of bytes is segmentation. Segmentation distinguishes certain regions of memory from other regions. For example, an operating system stores program information in dedicated segments. ”

I do not quite get it.
For example, if I have the following program:
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
int x = 4;
int y = 5;
printf("%d\n", x+y);
system("PAUSE");
return 0;
}
So, what is stored in Segment Code, what in Segment Data, and what in Stack? Please.
Thanks a lot
The stack is your local variables (such as x and y). The code segment is for the binary code that is actually executed. Finally, the data segment is for values that your program uses (such as the PAUSE string there).