edited by
4,454 views
0 votes
0 votes

A copy constructor is invoked when :

  1. a function returns by value        
  2. an argument is passed by value
  3. a function returns by reference 
  4. none of the above
edited by

1 Answer

Best answer
0 votes
0 votes
In C++, a Copy Constructor may be called in following cases:
1. When an object of the class is returned by value.
2. When an object of the class is passed (to a function) by value as an argument.
3. When an object is constructed based on another object of the same class.
4. When compiler generates a temporary object.

 

Hence, ans B

Related questions

0 votes
0 votes
0 answers
2
rishu_darkshadow asked Sep 25, 2017
1,081 views
When a language has the capability to produce new data types, it is said to be :extensible encapsulated overloaded none of the above...