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

I was asked to write a program in c which when executed displays how many no.of clients are connected to the server.

2080


What is pivot in c?

737


Explain data types & how many data types supported by c?

781


How the c program is executed?

845


if (i = 0)printf ("True"); elseprintf("False"); Under what conditions will the above print out the string "True" a) Never b) Always c) When the value of i is 0 d) all of the above

888






What is an identifier?

787


Why is c faster?

752


What will the preprocessor do for a program?

753


How does selection sort work in c?

795


How can you tell whether a program was compiled using c versus c++?

811


What is an lvalue?

821


Is c object oriented?

701


How do you convert a decimal number to its hexa-decimal equivalent.Give a C code to do the same

846


How to implement a packet in C

2592


What is c programing language?

801