Is it safe to disable buffering with stdout and stderr?

前端 未结 5 461
我寻月下人不归
我寻月下人不归 2021-02-03 11:01

Sometimes we put some debug prints in our code this way

printf(\"successfully reached at debug-point 1\\n\"); 

some code is here

printf(\"successfully reached          


        
5条回答
  •  栀梦
    栀梦 (楼主)
    2021-02-03 11:33

    Uh, well. You're wrong. Precisely for this reason, stderr is not buffered by default.

    EDIT: Also, as a general suggestion, try using debugger breakpoints instead of printfs. Makes life much easier.

提交回复
热议问题