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 |
Is c++ fully object oriented?
Define what is constructor?
What is difference between initialization and assignment?
12 Answers HCL, HP, Infosys,
What does new in c++ do?
Differentiate between realloc() and free().
Why we use #include iostream in c++?
List the merits and demerits of declaring a nested class in C++?
Enter n no. of element and delete value from desire position
What is main function in c++ with example?
What is the difference between "calloc" and "malloc"?
What is math h in c++?
which operator is used for performing an exponential operation a) > b) ^ c) none