Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


explain memory layout of a C program

Answers were Sorted based on User's Feedback



explain memory layout of a C program..

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

explain memory layout of a C program..

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

Post New Answer

More C Interview Questions

Can you define which header file to include at compile time?

0 Answers   Aspire, Infogain,


what is the advantage of function pointer

16 Answers   CMC, CS, Freshdesk, L&T, LG Soft, Matrix, TCS,


How can I generate floating-point random numbers?

0 Answers  


write a program to print %d ?

12 Answers  


What is the most efficient way to count the number of bits which are set in a value?

4 Answers  


Explain the difference between exit() and _exit() function?

0 Answers  


When should the register modifier be used? Does it really help?

0 Answers  


whats the use of header file in c?

2 Answers  


What is the meaning of this decleration? unsigned char (*pArray[10][10]); please reply.

1 Answers  


Write a program to print “hello world” without using semicolon?

0 Answers  


helllo sir give me some information of the basic information the c as printf ,scanf , %d ,%f and why is the main use of these.

3 Answers  


Differentiate fundamental data types and derived data types in C.

0 Answers   HCL,


Categories