I has been reading a c++ program reference Manuel.It told something about cerr something related to cout and cin(I think).Is there really something like that.If someone could explain to me what are it's functions,syntax,stream extraction operator(<</>>) used etc it would be really helpfull.
thanks for your time
cyber dude
edit::correct me if I am wrong
Last edited on
there is 4 standart streams:
std::cin — buffered input
std::cout — buffered output
std::cerr — unbuffered output
std::clog — buffered output

cout is intended to be standard output: visible to end user.
cerr is unbuffered output, all data written to in will be immideatly pushed to target (so it will not lost if program crashes on next line)
clog is buffered output like cout

By default all output streams writes to the screen however you can redirect those streams to anything you like: cout to screen, clog to logfile and cerr to intricate hardware device which will call programmer, wake him up and force to fix the programm.

Topic archived. No new replies allowed.