search
Log In
Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
0 votes
427 views

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
in Object Oriented Programming
edited by
427 views
0
Is it option d) ?

1 Answer

0 votes
 
Best answer
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
2 answers
1
0 votes
1 answer
2
373 views
When a language has the capability to produce new data types, it is said to be : extensible encapsulated overloaded none of the above
asked Sep 26, 2017 in Object Oriented Programming rishu_darkshadow 373 views
1 vote
1 answer
3
1 vote
0 answers
4
191 views
(I) Each object in the active directory of windows 2000 has an access control list. (II) The scheme is a blueprint of all objects in the domain of windows 2000. Which of the following is true? only (I) only (II) both (I) and (II) None of the above
asked Sep 26, 2017 in Others rishu_darkshadow 191 views
...