Programmers often insert print statements during debugging. Such statements should always flush the stream. Forgetting to do so may cause output to be left in the buffer if the program crashes, leading to incorrect inferences about where the program crashed.
程序员经常在调试过程中插入输出语句,这些语句都应该刷新输出流。忘记刷新输出流可能会造成输出停留在缓冲区中,如果程序崩溃,将会导致程序错误推断崩溃位置。
本文讨论了程序员在调试过程中使用输出语句的重要性,并强调了刷新输出流以确保程序稳定性及准确判断程序崩溃点的必要性。
849

被折叠的 条评论
为什么被折叠?



