Subject / 929 questions

Programming MCQs

Page 7 of Programming multiple-choice questions with answers. Tap an option to check yourself.

Page 7 of 47

Advertisement
Advertisement
Question 130 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 138 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