Generally variables are stored in heap memory. When he
variables are created in stack?
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / rohit repale
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.
If the variables are created by new i.e. dynamic memory is
created then it use heap memory.
static & extern variables are stored in static memory.
And other normal variables are stored in stack.
| Is This Answer Correct ? | 3 Yes | 0 No |
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 when 'extern' and 'static' are initialized stored in data segment otherwise found in bss.
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 ? | 2 Yes | 0 No |
Answer / rahul
I am not sure about this answer but when you pass any
argument to any recursive or non-recursive function.
| Is This Answer Correct ? | 1 Yes | 1 No |
What are multiple inheritances (virtual inheritance)? What are its advantages and disadvantages?
Describe Trees using C++ with an example.
Does improper inheritance have a potential to wreck a project?
Write about the retrieval of n number of objects during the process of delete[]p?
Is c++ harder than java?
Explain how an exception handler is defined and invoked in a Program.
How to create a reference variable in C++
What is null and void pointer?
Write a program to calculate the following i want a c++program for this condition 1+4+9+16+….+100 Like this (1^2+2^2) Hint use function pow(a,b)
What are the extraction and insertion operators in c++?
What is polymorphism and its type in c++?
What is dev c++ used for?