In which memory a class gets stored(in heap /in stack)?
And why??
Answers were Sorted based on User's Feedback
The stack is a place in the computer memory where all the variables that are declared and initialized before runtime are stored. The heap is the section of computer memory where all the variables created or initialized at runtime are stored.
Hence,classes will be stored in heap memory.
| Is This Answer Correct ? | 6 Yes | 3 No |
Answer / ravi.g
Usually class will get stored when the object/s are created.
Class will get sored in stack segment when the object is
created inside the functions.
When objects are created globally they will get stored in
the data segment.
| Is This Answer Correct ? | 2 Yes | 3 No |
What is the difference between a shallow copy and a deep copy?
What are advantages and disadvantages of Design patterns?
Eplain extern keyword?
How do you remove an element from a set in c++?
What is the full name of logo?
Explain the difference between 'operator new' and the 'new' operator?
What is the difference between Class and Structure?
40 Answers HP, IBM, Samsung, TCS,
Explain the use of virtual destructor?
What is ios in c++?
write the programme that convert a interger to biniry number
When should I use unitbuf flag?
Is c++ a difficult language?