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 a lambda capture clause written as [&] mean?

  1. A Capture all used variables by reference
  2. B Capture all used variables by value
  3. C Capture nothing
  4. D Capture only this
Answer

Capture all used variables by reference

Capturing by reference is dangerous when the lambda outlives the enclosing scope. Capturing by value with [=] copies instead.

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