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
How const int *ourpointer differs from int const *ourpointer?
Is python written in c or c++?
What are the new features that iso/ansi c++ has added to original c++ specifications?
What is the use of seekg in c++?
What is c strings syntax?
What kind of problems can be solved by a namespace?
What is object in c++ example?
Mention the purpose of istream class?
What are the benefits of pointers?
Describe the role of the c++ in the tradeoff of safety vs. Usability?
Arrange Doubly linked list in the ascending order of its integral value and replace integer 5 with 7?
To what does “event-driven” refer?
What is the difference between structures and unions?
If dog is a friend of boy, and terrier derives from dog, is terrier a friend of boy?
What are the benefits of operator overloading?