← Back to archive

Stdle #45 · conversions · 2026-07-21

What does this C++ snippet output?

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

#include <iostream>
struct Temp {
int v;
Temp(int n) : v(n) {}
};
int describe(Temp t) { return t.v * 2; }
int main() {
std::cout << describe(21) << "\n";
return 0;
}
Conversions
4 attempts left

Answer & explanation