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
Give two or more real cenario of virtual function and vertual object
Is oop better than procedural?
Will I be able to get a picture in D drive to the c++ program? If so, help me out?
Why multiple inheritance is not possible?
What is the significance of classes in oop?
What is basic concept of oop?
Can a destructor be called directly?
Write a program to sort the number with different sorts in one program ??
What is static in oop?
What is static modifier?
What is multilevel inheritance in oop?
Can bst contain duplicates?
What is overriding vs overloading?
What is polymorphism in oop example?
Why is there no multiple inheritance?