Qualcomm Interview Question
Software Engineer / DevelopersData segment is divided into 3 parts data, BSS, Heap
data part is further divided into 2 parts Read only memory & read write memory...
all global and static variables that are intialsed to a value but not to '0'(deafult intialisation) are stored in data part.
All constats are stored in Read only memory in data part.
BSS - All global and static variables which are not initialized to any value (but will be initialized to 0 as default initialization) will be stored in BSS part.
Heap - managed by malloc, calloc, realloc...
Please read the wiki for data segment..
@Jiez...its mentioned tht the main memory (RAM) is divided in 2 parts - data segment and stack..and data segment is further divided into 3 parts...the above mentioned main memory is only a part of the main memory which doesn't include the address space occupied by OS or device drivers or any ISR...
Global and static variables are stored in bss section of the data segment. Local variables are stored on the stack and are valid until the program exits from the function in which they are defined.
- Gavid December 07, 2009Any comments on optimization, guys?