If fclose(0) is called, does this close stdin?

后端 未结 4 908
既然无缘
既然无缘 2021-02-13 22:22

If fclose(0) is called, does this close stdin?

The reason why I\'m asking this is that for some reason, stdin is being closed in my application and I cannot figure out

4条回答
  •  北恋
    北恋 (楼主)
    2021-02-13 23:12

    fclose(0) invokes undefined behavior, so yes, it could do anything, including closing stdin. But you have much bigger problems if fclose(0) appears in your code.

提交回复
热议问题