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
Is c++ slower than c?
How do you sort a sort function in c++ to sort in descending order?
Explain "const" reference arguments in function?
What do you know about near, far and huge pointer?
Which is better c++ or java?
How a macro differs from a template?
If dog is a friend of boy and boy is a friend of house, is dog a friend of house?
program explaining feautures of c++
Which is not an ANSII C++ function a) sin() b) tmpnam() c) kbhit()
What do you mean by function pointer?
Difference between a copy constructor and an assignment operator.
which operator is used for performing an exponential operation a) > b) ^ c) none
Reverse the Linked List. Input: 1->2->3->4->5->NULL Output: 5->4->3->2->1->NULL
Differentiate between a copy constructor and an overloaded assignment operator.
What are stacks?