From Jason Turner
Watch on YouTube

Summary

Jason Turner explains the proper use of C++'s standard output streams: cout, cerr, and clog. He argues against the common practice of using std::endl, which unnecessarily flushes the output buffer with every newline. Instead, he recommends using the ' ' character for newlines. For debugging output that needs immediate flushing, Jason recommends using cerr rather than cout with endl, as cerr is designed to be unbuffered by default. He also mentions clog as a buffered alternative to cerr for non-critical error logging.

Resources

Tags