LearnFrenzy
Sign in Take a free test

Lambda Expressions · Lambda MCQ · Question 7

Which lambdas convert to function pointers? Answer, explanation & discussion

  • MCQ
  • Medium
  • 0 comments
  • Answer explained
  • Moderated community
Question 7 Back to Exercise

Which lambda can be assigned to int (*fp)(int)?

  • A [x](int a) { return a + x; }
  • B [](int a) { return a * 2; } Correct
  • C [&](int a) { return a; }
  • D [=](int a) { return a; } using a local
Correct Answer: Option B

Only lambdas without captures convert; captured state has nowhere to live in a plain function pointer.

Discussion & Comments 0

Share your method, a shortcut, or ask about a step you didn't follow.

No comments yet. Be the first to share your solution!

Post your comment

Comments appear after a quick review by our team.

Search LearnFrenzy

Esc

Quick links