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
State the difference between pre and post increment/decrement operations.
How is c++ different from java?
Why do we need constructors in c++?
Is dev c++ a good compiler?
Difference between overloaded functions and overridden functions
What is c++ programming language?
What are manipulators used for?
Define 'std'.
What is function overriding in c++?
Is it possible to use a new for the reallocation of pointers ?
What is DlgProc?
What are the various access specifiers in c++?
Difference between overloading vs. Overriding
What things would you remember while making an interface?
Can we use pointers in c++?