All challenges
Multiple ChoiceIntermediate 45s

Top-level const in function parameters

In a function declaration `void f(const int x)` at namespace scope, the top-level `const` on the parameter:
Options
  1. 1Is ignored for the function's type/signature; `f(int)` and `f(const int)` declare the same function.
  2. 2Creates a distinct overload, so `f(int)` and `f(const int)` may coexist as two different functions.
  3. 3Makes the parameter const in the caller's scope as well, so the caller's argument becomes non-modifiable.
  4. 4Prevents the function from being called with an rvalue argument, since a const parameter cannot bind to one.

Think you can answer under pressure?

Get matched and answer live questions in 3-minute 1v1 battles. Elo ranking, badge tiers and bragging rights on the line.

Play this in a 3-minute battle