← Back to archive

Stdle #165 · numbers · 2026-11-18

What does this C++ snippet output?

A past puzzle — fully playable. 4 attempts, hints on wrong guesses.

#include <iostream>
int main() {
bool called = false;
auto f = [&]{ called = true; return false; };
bool r = (true || f());
std::cout << r << " " << called << "\n";
}
Numbers
4 attempts left

Answer & explanation