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
How does com provide language transparency?
Will a recursive function without an end condition every quit, in practice a) Compiler-Specific (Some can convert to an infinite loop) b) No c) Yes
What is public, protected, private in c++?
Explain what you mean by a pointer.
Difference between delete and free.
How many types of modularization are there in c++?
What is the C-style character string?
Why do we need pointers?
What is the difference between equal to (==) and assignment operator (=)?
What is meant by iomanip in c++?
Why do we use iterators?
What is decltype c++?
Write a recursive program to calculate factorial in c++.
What does it mean to declare a member function as virtual?
Write a Program for find and replace a character in a string.