lundi 11 janvier 2016

why data and text segments sizes are constant while heap and stack sizes are dynamic?

Data and text segments sizes are not growing/shrinking while running a program. 1.Who will decide data and text segments sizes and when(before compilation, while compilation or after compilation a program)? 2. How they will decide how much space/memory is required for this program?

int a=10; //L1
int b=20; //L2
int main()
{ 
   return 0;
}

In the above program. 3.Data segment's size is decided before line L1?If yes, on what bases they have decided it? If not, where "a"(variable, int a=10) will be stored as yet we not decided size of segment?

Thanks in advance.

Aucun commentaire:

Enregistrer un commentaire