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
What is binary object model?
What is the use of data hiding?
What is the type of 'this' pointer? When does it get created?
Is map ordered c++?
What is binary search in c++?
What is ctime c++?
How to defines the function in c++?
Is swift faster than go?
Can the operator == be overloaded for comparing two arrays consisting of characters by using string comparison?
What are the various oops concepts in c++?
How is c++ used in the real world?
Is C++ case sensitive a) False b) Depends on implementation c) True
What is long in c++?
Difference between declaration and definition of a variable.
We all know that a const variable needs to be initialized at the time of declaration. Then how come the program given below runs properly even when we have not initialized p?