where is memory for struct allocated?
where is memory for class-object allocated?
I replied for struct in stack and for class-object in heap.
THen he asked if class has struct member variable what
happens.class on heap and what about struct in that class?
couldnt ans :( :-?
Answer Posted / vishwa
Both are allocated in heap.
Also if any structure is declared in a function, the
function stack creates a heap from the stack. so these
structures in function allocates in heap.
| Is This Answer Correct ? | 3 Yes | 2 No |
Post New Answer View All Answers
How many human genes are polymorphic?
What are properties in oop?
What is use of overloading?
• What are the desirable attributes for memory managment?
How do you define a class in oop?
What is the highest level of cohesion?
if i have same function with same number of argument but defined in different files. Now i am adding these two files in a third file and calling this function . which will get called and wht decide the precedence?
How does polymorphism work?
What is the real time example of inheritance?
2. Give the different notations for the class.\
What is polymorphism explain its types?
what is different between oops and c++
What is static in oop?
What is polymorphism what are the different types of polymorphism?
What is overloading in oops?