C++ › I/O Streams

What are C++ I/O streams?

Beginner

Answer

C++ streams are a type-safe, extensible I/O abstraction in <iostream>: std::cin (input), std::cout (output), std::cerr (unbuffered error), and std::clog (buffered log). They use operator<< (insertion) and operator>> (extraction), which are overloadable for user types, unlike C's printf/scanf format strings.
std::cout << "value: " << 42 << "\n";
int x; std::cin >> x;
Real-world example A program reads user input with std::cin and prints results with std::cout using overloaded operators.

Common follow-ups: What are cin, cout, cerr, clog? | Why are streams type-safe?