Computer Science, asked by kaabwattoo178, 8 months ago

4. It’s necessary to pass object by reference in copy constructor because ____________
a) Constructor is not called in pass by reference
b) Constructor is called in pass by reference only
c) It passes the address of new constructor to be created
d) It passes the address of new object to be created.​

Answers

Answered by Anonymous
0

Answer:

using copy constructed...,.,.,.,.,

Answered by shishir303
0

It’s necessary to pass an object by reference in copy constructor because__

a) Constructor is not called in pass by reference

b) Constructor is called in pass by reference only

c) It passes the address of new constructor to be created

d) It passes the address of new object to be created.​

The Correct Option is...

a) Constructor is not called in pass by reference

Explanation ⦂

The object is passed by reference to the copy constructor, this is because the constructor is not called by pass-by-reference. That's why the object is passed by reference to the copy constructor. If it doesn't then pass by value will create a temporary object which in turn will also try to call its constructor, which is already being used. Such a situation can cause an infinite number of objects to be created and result in a memory deficit showing the list. That's why it is necessary to pass the object by reference to the copy constructor.

#SPJ3

Similar questions