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
Using a smart pointer can we iterate through a container?
Write a corrected statement in c++ so that the statement will work properly. if (4 < x < 11) y=2*x;
What do the keywords volatile and mean mutable?
Why should we use null or zero in a program?
How can an improvement in the quality of software be done by try/catch/throw?
Is empty stack c++?
Explain the difference between struct and class in terms of access modifier.
Write a note about the virtual member function?
How do you declare A pointer to a function which receives nothing and returns nothing
Describe public access specifiers?
What is decltype c++?
Will the following program execute?
What is a container class?
What is class definition in c++ ?
What is const pointer and const reference?