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 |
Which uses less memory? a) struct astruct { int x; float y; int v; }; b) union aunion { int x; float v; }; c) char array[10];
What are single and multiple inheritances in c++?
What is name hiding in c++?
What are the restrictions apply to constructors and destructors?
if int1 has the value 12, int has the value 18, and int3 has the value 21, what is the result: int1 < int2 && int2 < int 3
which is best institue to learn C/C++ IN AMEERPET OR MAITHRIVANAM OR SR NAGAR, PLEASE HELP. THANKS IN ADVANCE
Can you be able to identify between straight- through and cross- over cable wiring? And in what case do you use straight- through and cross-over?
Describe the setting up of my member functions to avoid overriding by the derived class?
which is the easy way to divide any integer by 2?
How is static data member similar to a global variable?
What is function prototyping?
What is object in c++ wikipedia?