← Back to archive

Stdle #48 · strings · 2026-07-24

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 = "abcdef";
std::cout << s.substr(4) << "\n";
}
Strings
4 attempts left

Answer & explanation