Topic / 110 questions

C++ MCQs

Page 3 of C++ multiple-choice questions with answers. Tap an option to check yourself.

Page 3 of 6

Advertisement
Advertisement
Question 50 C++

Why can std::sort NOT be used directly on a std::list?

Correct answer A. std::sort needs random-access iterators but std::list provides only bidirectional iterators

Open question
Advertisement
Question 58 C++

How does a constexpr variable differ from a const variable in C++?

Correct answer D. A constexpr variable must be initialised with a constant expression evaluated at compile time

Open question