Generally variables are stored in heap memory. When he
variables are created in stack?
Answer Posted / vadivelt
It is wrong to say that genarally variables will be stored
in heap memmory.
Bcos Storage area always depends on the storage class of
the variable.
According to the C standard the storage will be.
1.variable with storage class 'auto' ie., local to the
function - in stack memory.
2.variable with storage class 'extern' and 'static' in data
segment.
3.variable with storage class 'register' in processor
register. But this register variable will be treated as
auto when there is no enough memory in the processor.
| Is This Answer Correct ? | 15 Yes | 0 No |
Post New Answer View All Answers
What do you mean by delegate? Can a user retain delegates?
Who calls main function?
What is constructor and destructor in c++?
What are the classes in c++?
What are the different types of comments allowed in c++?
Please explain class & object in c++?
Define pointers?
Can turbo c++ run c program?
Explain how functions are classified in C++ ?
Where are setjmp and longjmp used in c++?
what is multi-threading in C++?
Which programming language is best?
Can we sort map in c++?
What is the difference between a definition and a declaration?
what is a class? Explain with an example.