← Back to archive

Stdle #85 · classes · 2026-08-30

What does this C++ snippet output?

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

#include <iostream>
int main() {
int x = 11;
int& r = x;
const auto& cr = r; // auto& keeps ref; const added
x = 22;
std::cout << cr << "\n"; // tracks x
return 0;
}
Classes
4 attempts left

Answer & explanation