+ 4

what is the difference between cout, cerr and clog

13th Jul 2017, 6:15 PM
‎ ‏‏‎Anonymous Guy
4 RĂ©ponses
+ 4
cout : Regular output cerr - Error output clog - Nobody cares (just a classic console log)
13th Jul 2017, 6:22 PM
exybore
exybore - avatar
+ 10
#include<iostream> #include<exception> int main() { try { //User's code here //eg // int a; // cin>>a; // cout<< a/0 <<endl; //Obviously error generating... } catch(exception& e) { cerr<<"Some Unexpected Error Occured. "<<e.what()<<endl; //This will write this message along with the error //name in the standard error handling stream... } }
14th Jul 2017, 3:12 PM
Solo Wanderer 4315
Solo Wanderer 4315 - avatar
+ 2
can u give example of cerr
13th Jul 2017, 6:47 PM
‎ ‏‏‎Anonymous Guy
+ 1
thanks @kinshuk
14th Jul 2017, 5:47 PM
‎ ‏‏‎Anonymous Guy