← Back to archive

Stdle #12 · strings · 2026-06-18

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 a = "abc", b = "abd";
std::cout << (a < b) << " " << (a == "abc") << "\n";
}
Strings
4 attempts left

Answer & explanation