C + + system pre-defined 4 for standard data flow objects
CIN cout Cerr Clog
C + + in the cerr,clog, cout three differences:
Cerr (No buffer standard error)-----without buffering, the content sent to it is immediately output
Clog (with buffer standard error)--------buffer, buffer full-time output
cout-------------------------Standard Output
Contact: Three each is an output stream object defined by the Ostream class,
Cout is in the terminal display output, the cout stream in memory corresponds to open up a buffer, used to store the data in the stream,
However, when a endl is inserted into the cout stream, all data in the stream is immediately output, regardless of whether the buffer is diffuse, and then a newline character is inserted.
The Cerr Stream object is the standard error stream, which is specified as associated with the monitor, and the cout function is similar, a little different is cout
It is usually transmitted to the display output, but can be redirected to a file, and the information in the Cerr stream can only be output on the monitor.
The clog stream is also a standard error stream, with the same effect as Cerr , except that the Cerr does not pass through the buffer and outputs the information directly to the monitor, and the information in the clog is stored in the buffer, Output when the buffer is full or when Endl is encountered.
C + + system pre-defined 4 for standard data flow objects