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 / shanthila
use copy constructors
| Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
Why #include is used?
What is type of 'this' pointer? Explain when it is get created?
Which function cannot be overloaded c++?
What is using namespace std in cpp?
How do I run c++?
Explain how we implement exception handling in c++?
What is the use of this pointer in c++?
Write about the members that a derived class can add?
What can I use instead of namespace std?
Difference between class and structure.
Which bit wise operator is suitable for turning off a particular bit in a number?
why and when we can declar member fuction as a private in the class?
Can you overload the operator+ for short integers?
Give 10 points of differences between C & C++.
What is abstraction in c++?