

Uninitialized data segment often called the “ bss” segment, named after an ancient assembler operator that stood for “ block started by symbol.” Data in this segment is initialized by the kernel to arithmetic 0 before the program starts executing And a global C statement like const char* string = “hello world” makes the string literal “hello world” to be stored in the initialized read-only area and the character pointer variable string in the initialized read-write area.Įx: static int i = 10 will be stored in the data segment and global int i = 10 will also be stored in data segment global) would be stored in the initialized read-write area. This segment can be further classified into the initialized read-only area and the initialized read-write area.įor instance, the global string defined by char s = “hello world” in C and a C statement like int debug=1 outside the main (i.e. Note that, the data segment is not read-only, since the values of the variables can be altered at run time. A data segment is a portion of the virtual address space of a program, which contains the global variables and static variables that are initialized by the programmer. Initialized data segment, usually called simply the Data Segment.

