Quiz · Functions · lesson 10 of 11
Quiz — what the lambda captures
What does the program print?
#include <iostream>
int main() {
int x = 1;
auto get = [x]() { return x; };
x = 5;
std::cout << get() << ' ' << x;
}What does the program print?
#include <iostream>
int main() {
int x = 1;
auto get = [x]() { return x; };
x = 5;
std::cout << get() << ' ' << x;
}