In a class, there is a reference or pointer of an object of
another class embedded, and the memory is either allocated
or assigned to the new object created for this class. In
the constructor, parameters are passed to initialize the
data members and the embedded object reference to get
inialized. What measures or design change should be advised
for proper destruction and avioding memory leaks, getting
pointers dangling for the embedded object memory
allocation? Please suggest.
Answer Posted / mms zubeir
Sorry, there is an error in my above answer. In the first
statement, it is container class, not contained class.
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Difference between declaration and definition of a variable.
What is the difference between object-oriented programming and procedural programming?
What is the latest c++ version?
Can we overload operator in c++?
What is c++ course?
What is microsoft c++ redistributable 2013?
Explain the difference between realloc() and free() in c++?
What is the use of :: operator in c++?
What are vtable and vptr?
You want to link a c++ program to c functions. How would you do it?
Explain the difference between struct and class in terms of access modifier.
What is a virtual destructor? Explain the use of it?
Is c++ vector a linked list?
Write a program using merge () function to combine the elements of array x[ ] and y[ ] into array z[ ].
How a modifier is similar to mutator?