Login to manage your account

Please enter a valid email address.
Forgot Password?
Please enter a valid password.
OR

Don't have an account yet? Sign up

What does the explicit keyword on a single-argument constructor prevent?

  1. A Implicit conversions from the argument type to the class type
  2. B The constructor being called at all
  3. C Copy construction
  4. D Inheritance
Answer

Implicit conversions from the argument type to the class type

Without explicit, a function taking your class silently accepts an int or string, producing surprising conversions.

All C++ MCQs

Login to manage your account

Please enter a valid email address.
Forgot Password?
Please enter a valid password.
OR

Don't have an account yet? Sign up as