← Back to archive

Stdle #42 · conversions · 2026-07-18

What does this C++ snippet output?

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

#include <iostream>
int main() {
std::cout << std::boolalpha;
int arr[3] = {0, 0, 0};
std::cout << static_cast<bool>(arr) << "\n";
return 0;
}
Conversions
4 attempts left

Answer & explanation