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 scope resolution operator in c++ with example?
What is a singleton c++?
What is a sequence in c++?
Do you know what are static and dynamic type checking?
What is one dimensional array in c++?
What is c++ prototype?
What are the different types of polymorphism in c++?
How would you use the functions randomize() and random()?
What does count ++ do in c++?
Explain the concept of friend function in c++?
Which is better c++ or java?
What is setbase c++?
why is c++ called oops? Explain
Implement stack operations with pointers with appropriate exception checks.
Why do we use structure in c++?