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
What is the difference between inheritance and polymorphism?
i am getting an of the type can not convert int to int *. to overcome this problem what we should do?
Can private class be inherited?
What is constructor in oop?
which feature are not hold visual basic of oop?
#include
What are two types of polymorphism?
What are the benefits of interface?
Give two or more real cenario of virtual function and vertual object
What is polymorphism and its types?
What is the difference between abstraction and polymorphism?
What do you mean by overloading?
What is the point of polymorphism?
i got a backdoor offer in process global,Bangalore..Can i work with it?
What is destructor oops?