A copy constructor has the same name as the class (let’s call it A) and has a parameter that
a) Is call-by value of an A object
b) Is call-by-reference of another class
c) Is call-by-reference of an A class object
d) Is call-by-name of an object named ~A.
e) None of these
c) Is call-by-reference of an A class object
The reference is to break the recursion of A(A object) if a call-by-value were used. What happens is you are passing A object by value, this calls the copy constructor, which has an A object called by value which … and so on. Early C++ compilers would crash, using all of memory if you left out the &. Modern compilers in my experience catch this error.
You might also like to view...
A property that you create and add to a file that will help to find and organize your files is a(n)________
Fill in the blank(s) with correct word
Give pseudocode for inserting a node in front of the head node in a linked list.
What will be an ideal response?