V

Vinay • 28.75K Points
Instructor II

Q. Which of the following is the correct way to define a lambda function in C++?

  • (A) auto myLambda = [](int x) { return x * x; };
  • (B) lambda myLambda = [](int x) { return x * x; };
  • (C) Both A and B
  • (D) None of the above
  • Correct Answer - Option(A)
  • Views: 29
  • Filed under category C++

Explanation by: Vinay
The correct way to define a lambda function is 'auto myLambda = [](int x) { return x * x; };'.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.


Question analytics