← Back to archive

Stdle #108 · strings · 2026-09-22

What does this C++ snippet output?

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

#include <iostream>
#include <string>
int main() {
std::string s = "abc";
char c = s[10];
std::cout << (int)c << "\n";
}
Strings
4 attempts left

Answer & explanation