explain memory layout of a C program

Answer Posted / ravindra garg

(Higher Memory Address)

STACK -->Func arguments and return val(locals)
'
'
|
^
'
HEAP --> Dynamic Data

BSS --> Uninitialized Data
(Global and static default to zero)

DATA SEGMENT --> Initilialised data
(Global and static with init vals)

CODE SEGMENT --> Instructions

[Lower Memory Address]

Is This Answer Correct ?    38 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the value of a[3] if integer a[] = {5,4,3,2,1}?

672


How can you determine the maximum value that a numeric variable can hold?

641


What are the preprocessor categories?

639


What are the scope of static variables?

601


Do you have any idea how to compare array with pointer in c?

604






What is the difference between char array and char pointer?

527


Explain do array subscripts always start with zero?

761


What are types of functions?

567


"C" language developed by "Dennis Ritchie" at AT & T. his remarks are a) too general, too abstract b) could deal with only specific problems c) lost generality of BCPL and B restored d) no remarks

660


What is the purpose of sprintf?

622


What is the difference between union and anonymous union?

835


How do I convert a string to all upper or lower case?

629


How was c created?

589


What is #ifdef ? What is its application?

649


Can you please explain the difference between syntax vs logical error?

697