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
What is a constructor in c++ with example?
Explain binary search.
How important is c++?
Write a corrected statement in c++ so that the statement will work properly. if (4 < x < 11) y=2*x;
What is the use of structure in c++?
Which one is a preferred language C or C++? Why?
What is microsoft c++ redistributable?
What is namespace std; and what is consists of?
How does a copy constructor differs from an overloaded assignment operator?
What is the full form of india?
What is the latest c++ version?
Write a program which uses Command Line Arguments
What is implicit pointer in c++?
What are manipulators used for?
What is the sequence of destruction of local objects?