explain memory layout of a C program
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / pankaj saraf
Memory Layout consists following segments where data/text
are managed:
1) Text Segment : Consists serial of instruction.
2) Data Segment : Consists, Data default or defined class
specifier
i) Stack Segment : Area where the current function data
is managed.
ii) Heap Segment : Area where dynamically allocated data
stored.
3) BSS Segment: For uninitialized data.
Data segment is actually contains the static data which is
decided on the compile time. Rest of Area is used by Stack
and Heap which is actually modified run time. Stack grows
from higher address to lower Address. Heap grow just
opposite to the stack.
Anything else you guys are invited to add. :)
| Is This Answer Correct ? | 36 Yes | 7 No |
how to find the given number is prime or not?
Hai why 'c' is the middle language
What is 1d array in c?
What is the function of this pointer?
0 Answers Agilent, ZS Associates,
What is Bitwise Operator and how it works?
When should you use a type cast?
A collection of data with a given structure for excepting storing and providing on demand data for multiple users a) linked list b) datastructer c) database d) preprocessor
What's a "sequence point"?
‘SAVEPOINT’ and ‘ROLLBACK’ is used in oracle database to secure the data comment. Give suitable examples of each with sql command.
How can I read a binary data file properly?
difference between c and c++
WHAT IS ABSTRACT DATA TYPE