Shall I use cerr

后端 未结 4 1207
清歌不尽
清歌不尽 2021-01-04 10:30

Is it in good style do use cerr in situation described below?

try
    {
    cout << a + b;
    }
    catch(const IntException& e)
    {
        c         


        
4条回答
  •  一个人的身影
    2021-01-04 11:16

    Sure, it's good to use cerr there. You can redirect cerr differently from cout, sometimes that helps you to highlight problems that could go buried in a huge cout log file.

提交回复
热议问题