C Language Program after compiling the link to form a binary image file consists of stacks, heaps, data segments, code snippets, wherein the data segment is divided into: read-only data segment, has initialized the read and write data segments, uninitialized data segment (BSS). As shown in the following:
1. Stack: The compiler automatically allocates releases, stores the function's parameter values , and local variables are equivalent. It operates in a manner similar to a stack in a data structure.
2. heap: Usually released by the programmer, if the programmer does not release, it may cause memory leaks.
Note: 1) stacks and data structures are not the same stack, whose classes are linked lists.
2) The so-called memory leak refers to the program running in the memory of the less, if the program is finished, then the operating system will automatically release its occupied memory.
3. Program code area: the binary code that holds the function body , this part is only readable and not writable.
4. Data section:
1) Read-only data segments: read-only data segments are data that the program uses that are not changed and stored in read-only memory (along with the code area). It is generally a const-Modified variable and some literal constants used in the program .
2) initialized read-write data segment: A variable declared in the program, and has the initial value, in the program run in a writable memory area, generally Initialized Global Variables , initialized static local variable .
3) uninitialized segment (BSS): Uninitialized data is declared in the program, but there are no initialized variables, which belong to the static store. Uninitialized data segments are generated only during the initialization phase of the run, so its size does not affect the size of the destination file. In a program, there are generally no initialized global variables and static local variables that are not initialized .
From for notes (Wiz)
List of attachments
6.4 Districts. doc