C/Memory

Advertisement


Question
-------------------------
Followup To
Question -
hi,
 where in memory the variables are stored?
Local variables, global variables, static.

Answer -
Local variables sit in Stack.
Global and static goto Data segment.
Dynamic memory comes from Heap.

Thanks for the inputs.

Apart from this i need to know exactly whether these variables will be stored in ROM or RAM.

Answer
ROM is Read Only Memory.
So, that means you cannot write into it.
So, your program doesn't have anything to do with ROM.

RAM is Random Access Memory and all the programs will sit in RAM. The space allocated for a particular program in RAM is called Address Space.

-Narendra

C

All Answers


Answers by Expert:


Ask Experts

Volunteer


Narendra

Expertise

I can answer questions in C related to programming, data structures, pointers and file manipulation. I use Solaris for doing C code and if you have questions related to C programming on Solaris, I will be able to help better.

Experience

6.5

Organizations belong to
Sun Microsystems

Awards and Honors
Brain Bench Certified Expert C programmer.
Advanced System Software Certified

©2012 About.com, a part of The New York Times Company. All rights reserved.