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 pure oop?
What is the purpose of enum?
What is encapsulation with real life example?
2. Give the different notations for the class.\
class type to basic type conversion
What is the fundamental idea of oop?
Can we create object of abstract class?
INSTANCE FIELDS DECLARED private ARE ACCESSIBLE BY THE METHODS ONLY.CAN WE CHANGE THE private FIELD OF AN OBJECT IN A METHOD OF SOME OTHER OBJECT OF THE SAME CLASS?
What is object in oop?
What is Difeerence between List obj=new ArrayList(); and ArrayList obj=new ArrayList()?
What is use of overloading?
write a program to find 2 power of a 5digit number with out using big int and exponent ?
What are the three main types of variables?
What does sksksk mean in text slang?
write a C++ program for booking using constructor and destructor.