Is it in good style do use cerr in situation described below?
try
{
cout << a + b;
}
catch(const IntException& e)
{
c
Yes, because while by default they both go to the terminal, you could change where their output is directed, and you may wish cerr
to go to a log file while cout
continues to just go to stdout
.
Essentially it gives you more control over where different output goes if you want it now or in the future.