printf flush at program exit

前端 未结 4 1106
萌比男神i
萌比男神i 2020-12-16 17:54

I\'m interested in knowing how the printf() function\'s flush works when the program exits.

Let\'s take the following code:

int main(int         


        
4条回答
  •  被撕碎了的回忆
    2020-12-16 18:05

    The C runtime will register atexit() handlers to flush standard buffers when exit() is called.

    See this explanation.

提交回复
热议问题