cin, cout, cerr and clog in brief

1 view
Skip to first unread message

Venkatesh Raja

unread,
Feb 3, 2005, 8:24:50 AM2/3/05
to cppf...@googlegroups.com
cin - This object provides for input from the terminal (keyboard)

cout - This object provides for output to the screen.

cerr - This object provides unbuffered output to the standard error
device, which defaults to the screen. Unbuffered means that any
messages or data will be written immediately. With buffered input,
data is saved to a buffer by the operating system, transparently to
your program. When the buffer is full, everything in it is written
out. This is more efficient because each write requires a certain
amount of overhead from the operating system. Writing out one large
buffer has less overhead than writing out multiple smaller messages.
The downside is that if a program crashes before the buffer is
written, nothing in the buffer is output. Output via cerr is
unbuffered to ensure that error messages will be written out.

clog - This object provides buffered output to the standard error
device, which defaults to the screen.


To find more ... http://cplus.about.com/od/beginnerctutorial/l/aa022302a.htm

--

Regards,

Venkatesan P.R,
India.

------------------------------------------------------
Reply all
Reply to author
Forward
0 new messages