Generally variables are stored in heap memory. When he
variables are created in stack?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is setw manipulator in c++?

593


Explain one-definition rule (odr).

642


When is dynamic checking necessary?

597


What is a singleton c++?

546


Describe the setting up of my member functions to avoid overriding by the derived class?

605






What is the cout in c++?

549


What is the difference between C and CPP?

624


What is a stack? How it can be implemented?

694


Difference between pointer to constant and constant pointer to a constant. Give example.

638


If a base class declares a function to be virtual, and a derived class does not use the term virtual when overriding that class, is it still virtual when inherited by a third-generation class?

606


Write about the members that a derived class can add?

565


What is the difference between an enumeration and a set of pre-processor # defines?

826


Which operations are permitted on pointers?

566


What is setf in c++?

575


What are the basics of local (auto) objects?

631