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!