Answer
std::cout is the standard output stream (buffered). std::cerr is the standard error stream, unbuffered so messages appear immediately (good for errors). std::clog is also for logging to standard error but buffered (more efficient for high-volume logs). Separating normal output from errors lets them be redirected independently.
std::cout << "result\n";
std::cerr << "error!\n"; // immediate, unbufferedReal-world example Errors go to std::cerr so they still appear even if stdout is redirected to a file.