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 is a character in c++?
How do you initialize a string in c++?
How can you quickly find the number of elements stored in a static array?
Why c++ is faster than java?
which one is equivalent to multiplying by 2:Left shifting a number by 1 or Left shifting an unsigned int or char by 1?
What do you mean by function pointer?
Explain rethrowing exceptions with an example?
Why do we need c++?
What is the use of map in c++?
Why c++ is not a pure oop language?
What is singleton pattern in c++?
describe private access specifiers?
What is expression parser in c++
If you want to share several functions or variables in several files maitaining the consistency how would you share it?
How do you establish an is-a relationship?