← Quiz: Copy Constructor and Deep Copy: all 10 questions
Quiz: Copy Constructor and Deep Copy · Question 1 of 10
Which function runs for Student b = a; when b is being declared?
Which function runs for Student b = a; when b is being declared?
- A.Copy assignment operator
- B.Copy constructor
- C.Default constructor, then assignment
- D.Destructor
Answer & explanation
Correct answer: Copy constructor
b is a new object, so it is constructed — the = here is initialisation, not assignment.
Can you get the rest right without peeking?
Take the timed Quiz: Copy Constructor and Deep Copy quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →