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
Explain the difference between static and dynamic binding of functions?
What is the difference between public, private, and protected access?
How would you use the functions randomize() and random()?
What are the unique features of C++.
Is swift faster than c++?
How can you quickly find the number of elements stored in a dynamic array? Why is it difficult to store linked list in an array?
Explain the differences between list x; & list x();.
What is the real purpose of class – to export data?
Does c++ have arraylist?
Is it possible to write a c++ template to check for a function's existence?
explain the reference variable in c++?
What is the word you will use when defining a function in base class to allow this function to be a polimorphic function?
Explain terminate() and unexpected() function?
Am pass the 10000 records to target in target I will take commit interval 15000 when I was stop the work flow what will happened
Explain how overloading takes place in c++?