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
Write a program for Divide a number with 2 and Print the output ( NOTE: Check for divide by zero error).
What are the general quetions are in DEna bank manager IT/System interviews?
What is data abstraction? How is it different from data encapsulation?
Write a program which is required to process the time of a clock in hours and minutes, entered from the keyboard. With this program, there are two requirements for any data entered by a user: 1. The data must be of the correct type (in this case, two ints). 2. The data must be in the correct range: this means that, for the minutes, negative numbers and any number above 59 must be rejected; for the hours, negative numbers and any number above 23 must be rejected. Output error message for invalid data input. Output the time one and a half hour after the time input. i.e. Hour: 22 Min: 32 One and a half hour after 22:32 is 00:02
What is a buffer c++?
Can c++ do everything c can?
What is the difference between delegation and implemented-in-terms-of?
How do you declare A pointer to function which receives an int pointer and returns a float pointer
How do pointers work?
What does 7/9*9 equal ? a) 1 b) 0.08642 c) 0
What flag means?
Why can’t you call invariants() as the first line of your constructor?
Explain method of creating object in C++ ?
Explain the virtual inheritance in c++.
What is std namespace in c++?