when can we use copy constructor?

Answer Posted / praveen

A copy constructor is used in the following cases.
* When compiler generates a temporary object.
* When an object is return type of pointer.
* This is a temporary object.

Is This Answer Correct ?    2 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is lvalue?

684


What is a namespace in c++?

590


What are the rules for naming an identifier?

549


What is a character in c++?

555


Can I learn c++ without knowing c?

583






Write about c++ storage classes?

736


What are arithmetic operators?

525


What is a pointer how and when is it used?

565


Explain polymorphism?

574


Where and why do I have to put the "template" and "typename" keywords?

572


Write some differences between an external iterator and an internal iterator?

568


What is the basic of c++?

590


Which software is used to run c++ program?

542


Differentiate between a pointer and a reference with respect to c++.

690


Write a single instruction that will store an EVEN random integer between 54 and 212 inclusive in the variable myran. (NOTE only generate EVEN random numbers)

1479