Lambda capture by value
What does this program print?
#include <iostream>
int main() {
int multiplier = 10;
auto lambda = [multiplier](int x) { return x * multiplier; };
multiplier = 20;
std::cout << lambda(5);
}
Sign in to answer questions and track your progress
Sign In