devxlogo

Standard Streams

Standard Streams

C++ provides four standard I/O streams that are automatically instantiated before program’s outset. They are defined in the standard header :

 cin    // standard input stream of charcout  // standard output stream of char cerr  // standard unbuffered output stream for error messagesclog  // standard output stream for error messages

The difference between cerr and clog is that cerr is unbuffered, whereas clog is buffered. In addition, each of these four streams has a corresponding wide character version:

 wcin wcout wcerr wclog 

devx-admin

Share the Post: