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 |
Write a single instruction that will store an EVEN random integer between 54 and 212 inclusive in the variable myran. (NOTE only generate EVEN random numbers)
what are the characteristics of Class Members in C++?
When volatile can be used?
Why are arrays usually processed with for loop?
What is the use of class in c++?
Is there a datatype string in c++?How is the memory allocation?
Which of the following operator cannot be overloaded?
What is prototype in c++ with example?
What are the main differences between C and C++?
What are multiple inheritances (virtual inheritance)? What are its advantages and disadvantages?
Explain the difference between class and struct in c++?
What is the use of seekg in c++?