top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

C++: What is the functional difference between clog and cerr ?

0 votes
470 views
C++: What is the functional difference between clog and cerr ?
posted Aug 11, 2018 by Vikram Singh

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote

pointed out that cout and cerr actually write to separate streams, which happen to show up in the same place by default.

There is one other difference that can sometimes be quite significant: unitbuf is always true for cerr, which means that anything written to cerr is flushed after each output operation. By contrast, cout is typically line buffered, or (when directed to a file, fully buffered), though that’s not guaranteed.

There is also a clog stream, which (like cerr) writes to the standard error stream, but unlike cerr it can be line buffered or fully buffered.

answer Aug 12, 2018 by anonymous
Similar Questions
0 votes

I have seen at many places that object is passed as reference and as constant reference.
I want to know the usage of each one.

+1 vote

I know that list is used in C++ as we use linked list in C lang. Now, I want to know when forward list is used ?

...