Which of the following constructors can be provided implicitly by the C++…

2023

Which of the following constructors can be provided implicitly by the C++ compiler if they are not defined in a class?

  1. A.

    Copy constructor

  2. B.

    Default constructor

  3. C.

    Parameterized constructor

  4. D.

    More than one of the above

  5. E.

    None of the above

Attempted by 158 students.

Show answer & explanation

Correct answer: D

Correct answer: More than one of the above.

  • Default constructor: If a class has no user-declared constructor, the compiler implicitly declares a default constructor.

  • Copy constructor: If a class has no user-declared copy constructor, the compiler also implicitly declares a copy constructor, although it may be defined only when it is needed and may be deleted in some special cases.

  • Parameterized constructor: The compiler does not invent a user-style parameterized constructor. It must be written explicitly.

Therefore, both the default constructor and the copy constructor can be compiler-provided, so the best option is More than one of the above.

Explore the full course: Uppsc Polytechnic Lecturer 2025 Cs