1. Home
  2. Computer Science MCQs
  3. C++ and Object-Oriented Programming
  4. When is a copy constructor invoked?

Added 30 Nov -0001

When is a copy constructor invoked?

  1. When a static member is assigned
  2. When an object initialises another of its type Correct answer
  3. When a class declares a new object
  4. When a virtual call is made on an object

Correct answer

B. When an object initialises another of its type

13 views

MCQSEXAM

Explanation

The copy constructor runs whenever a new object is created from an existing object of the same class.

Reference

Asked in: NTS, PPSC IT, Campus Interviews

Preparing for an exam?

Doubts & discussion

Not sure why the answer is B? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More C++ and Object-Oriented Programming MCQs

Practise all C++ and Object-Oriented Programming MCQs

Similar MCQs