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 |
Why is c++ is better than c?
What does int * mean in c++?
What is pointer in c++ with example?
Can we define function inside main in c++?
write a porgram in c++ that reads an integer and print the biggest digit in the number
What are static member functions?
What is the meaning of string in c++?
We use library functions in the program, in what form they are provided to the program?
What is microsoft c++ redistributable?
What is helper in c++?
What is diamond problem in c++?
Why is main function important?