C++ | Constructors | Question 8
(A) Compiler Error
(B) x = 0 y = 0
(C) x = garbage value y = garbage value
Explanation: Compiler creates a copy constructor if we don’t write our own. Compiler writes it even if we have written other constructors in class. So the above program works fine. Since we have default arguments, the values assigned to x and y are 0 and 0.
Quiz of this Question