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 important is c++?
When should overload new operator on a global basis or a class basis?
What is #include iomanip?
Explain the concept of copy constructor?
What header file is needed for exit(); a) stdlib.h b) conio.h c) dos.h
What is different in C++, compare with unix?
Explain public, protected, private in c++?
What is vector pair in c++?
Are there interfaces in c++?
How does class accomplish data hiding in c++?
Write about the members that a derived class can add?
Why do we use classes in programming?
Assume studentNames and studentIDs are two parallel arrays of size N that hold student data. Write a pseudocode algorithm that sorts studentIDs array in ascending ID number order such that the two arrays remain parallel.
What is a wchar_t in c++?
How did c++ start?