← Back to archive

Stdle #64 · classes · 2026-08-09

What does this C++ snippet output?

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

#include <iostream>
int main() {
const int& r = 7 + 3; // binds to temporary
int x = 5;
const int& s = x * 2;
std::cout << r << " " << s << "\n";
return 0;
}
Classes
4 attempts left

Answer & explanation