← Back to archive

Stdle #24 · conversions · 2026-06-30

What does this C++ snippet output?

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

#include <iostream>
int main() {
char c = 'a';
int code = static_cast<int>(c);
char back = static_cast<char>(code + 4);
std::cout << code << back << "\n";
return 0;
}
Conversions
4 attempts left

Answer & explanation