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
write a program to enter a string like"sunil is a good boy and seeking for a job" not more than 10 characters including space in one line,rest characters should b in other line.if the next line starts from in between the previous word,then print whole word to next line.
How do you explain polymorphism?
Give two or more real cenario of virtual function and vertual object
What is polymorphism explain?
What are functions in oop?
What is inheritance in oop?
Is oop better than procedural?
what is different between oops and c++
What are main features of oop?
Plese get me a perfect C++ program for railway/airway reservation with all details.
Why is abstraction used?
Why do we need oop?
What is constructor in oop?
What is encapsulation oop?
What is abstraction with example?