when can we use copy constructor?

Answer Posted / sagarson

Copy constructors are called in following cases:
a) when a function returns an object of that class by value
b) when the object of that class is passed by value as an
argument to a function
c) when you construct an object based on another object of
the same class
d) When compiler generates a temporary object

Is This Answer Correct ?    7 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is c++ a good first language to learn?

578


What is increment operator in c++?

564


Can we define function inside main in c++?

557


How can you tell what shell you are running on unix system?

645


Write about c++ storage classes?

757






What is endl?

639


What is the use of c++ programming language in real life?

569


What is class invariant in c++?

750


Do you know the problem with overriding functions?

574


What is the fastest c++ compiler?

589


What are smart pointers?

672


Why is c++ is better than c?

519


what is data abstraction in C++?

655


What is stack unwinding?

608


What is c++ redistributable?

626