Answer Posted / madhu
Basic thing, copy constructor will be called whenever a copy
is made. and copy constructors are called when:
1. create a new object using existing object.
2. When is returning to caller.
3. When an object is passed by value as a parameter to a
function
Basically a default copy constructor will be created which
does bitwise copy also know as shallow copy.
This will become a problem when we are dealing with dynamic
memory allocation for variables and leads to dangling pointer.
To overcome we have to override by deep copy.
| Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
What is polymorphism explain its types?
What does sksksk mean in text slang?
What is new keyword in oops?
can inline function declare in private part of class?
What is a null tree?
What is difference between polymorphism and inheritance?
What is overloading in oops?
Why do pointers exist?
How to use CMutex, CSemaphore in VC++ MFC
How do you achieve polymorphism?
Why is there no multiple inheritance?
IS IT NECESSARY TO INITIALIZE VARIABLE? WHAT IF THE INSTANCE VARIABLE IS DECLARED final ? IS IT NECESSARY TO INITIALIZE THE final VARIABLE AT THE TIME OF THEIR DECLARATION?
any one please tell me the purpose of operator overloading
program for insertion ,deletion,sorting in double link list