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
when to use 'mutable' keyword and when to use 'const cast' in c++
What is object and example?
What are the advantages of polymorphism?
How do you explain polymorphism?
What is abstract class in oops?
what type of question are asked in thoughtworks pair programming round ?
Why we use classes in oop?
Plese get me a perfect C++ program for railway/airway reservation with all details.
Explain virtual inheritance?
What does <> mean pseudocode?
Can main method override?
Why do we need oop?
What are benefits of oop?
write a program using c++ to implement single contiguous memory mangement techniques.display the content of the main memory after yhe allocation of jobs and percentage of the wastage of the main memory
which feature are not hold visual basic of oop?