+ 3

What is the difference between cout<< and cerr<<

28th Mar 2017, 8:04 AM
Kaka
Kaka - avatar
4 Antworten
+ 8
Both of the above statements will be en-route the output to the the standard output device i.e., monitor, by default, but semantically both are different in essence that cout<< represent standard output stream and cerr<< represent standard error stream
28th Mar 2017, 8:53 AM
à€Šà„‡à€”à„‡à€‚à€Šà„à€° à€źà€čà€Ÿà€œà€š (Devender)
à€Šà„‡à€”à„‡à€‚à€Šà„à€° à€źà€čà€Ÿà€œà€š (Devender) - avatar
+ 6
With cerr<< the output is immediately sent to the standard error stream while cout<< the output first goes to the buffer
28th Mar 2017, 8:08 AM
Kaka
Kaka - avatar
+ 4
@Devender What about clog<<
28th Mar 2017, 9:22 AM
Kaka
Kaka - avatar
+ 3
clog<< is rarely used. In fact is mere a clone of cerr <<
28th Mar 2017, 12:03 PM
à€Šà„‡à€”à„‡à€‚à€Šà„à€° à€źà€čà€Ÿà€œà€š (Devender)
à€Šà„‡à€”à„‡à€‚à€Šà„à€° à€źà€čà€Ÿà€œà€š (Devender) - avatar