December Code

December Code / Try C++

Try C++

No account needed. Answer, see why, move on.

1 of 3 today

Lambdas & Move Semanticseasy

What does this C++ code print?

int x = 1;
auto byVal = [x] { return x; };
auto byRef = [&x] { return x; };
x = 5;
std::cout << byVal() << byRef();
Choose one option
choose an option

Nothing here is saved. Create a free account to keep your progress, take an assessment and get your readiness score.