In: Computer Science
Before showing the diagram let us understand first that what program segment is :
Program segment basically contains below subparts in it:
Text segment :
This segment only contains the executable instructions written in
text codes.
Data segment(Initialized and Uninitiated):
It is basically an virtual space used by program with the help of
global or local variables and initialized or uninitialized data
segments.
Stack:
It is the area where automatic variables are stored .
These area is used when we call any function in our program.
Heap:
It is area where dynamic allocation takes place.
It is managed by malloc,realloc and free in build functions.
Now let us see the below diagram of program segments:
PLEASE UP-VOTE ? ? IF YOU FIND THIS HELPFUL.
IN CASE OF ANY QUERIES AND CONCERNS, THEN PLEASE FEEL FREE TO WRITE IT IN COMMENT SECTION.