C++ MCQs with answers Page - 131

Here, you will find a collection of MCQ questions on C++. Go through these questions to enhance your preparation for upcoming examinations and interviews.

To check the correct answer, simply click the View Answer button provided for each question.

Have your own questions to contribute? Click the button below to share your MCQs with others!

+ Add Question

A

Admin • 833.24K Points
Coach

Q. Copy constructor must receive its arguments by __________ .

  • (A) either pass‐by‐value or pass‐by‐reference
  • (B) only pass‐by‐value
  • (C) only pass‐by‐reference
  • (D) only pass by address

A

Admin • 833.24K Points
Coach

Q. A function with the same name as the class, but preceded with a tilde character (~) is called __________ of that class.

  • (A) constructor
  • (B) destructor
  • (C) function
  • (D) object

A

Admin • 833.24K Points
Coach

Q. Which of the following gets called when an object goes out of scope?

  • (A) constructor
  • (B) destructor
  • (C) main
  • (D) virtual function

A

Admin • 833.24K Points
Coach

Q. _________ used to make a copy of one class object from another class object of the same class type.

  • (A) constructor
  • (B) copy constructor
  • (C) destructor
  • (D) default constructor

A

Admin • 833.24K Points
Coach

Q. Constructors __________ to allow different approaches of object construction.

  • (A) cannot overloaded
  • (B) can be overloaded
  • (C) can be called
  • (D) can be nested

A

Admin • 833.24K Points
Coach

Q. Which of the following cannot be declared as virtual?

  • (A) Constructor
  • (B) Destructor
  • (C) Data Members
  • (D) Both A and C

A

Admin • 833.24K Points
Coach

Q. If the copy constructor receives its arguments by value, the copy constructor would

  • (A) call one‐argument constructor of the class
  • (B) work without any problem
  • (C) call itself recursively
  • (D) call zero‐argument constructor

A

Admin • 833.24K Points
Coach

Q. Which of the following are NOT provided by the compiler by default?

  • (A) Zero‐argument Constructor
  • (B) Destructor
  • (C) Copy Constructor
  • (D) Copy Destructor

A

Admin • 833.24K Points
Coach

Q. It is a __________ error to pass arguments to a destructor.

  • (A) logical
  • (B) virtual
  • (C) syntax
  • (D) linker

A

Admin • 833.24K Points
Coach

Q. Which of the following is not a correct variable type?

  • (A) Float
  • (B) Real
  • (C) Int
  • (D) double

Add MCQ in this Category

If you want to share an MCQ question in this category, it's a great idea! It will be helpful for many other students using this website.

Share Your MCQ