printf just before a delay doesn't work in C

前端 未结 5 575
别那么骄傲
别那么骄傲 2020-12-11 05:23

Does anyone know why if i put a printf just before a delay it waits until the delay is finished before it prints de message?

Code1 with sleep():

int          


        
5条回答
  •  离开以前
    2020-12-11 06:07

    Normally, standard output is buffered until you either:

    • output a \n character
    • call fflush(stdout)

    Do one of these things before calling delay() and you should see your output.

提交回复
热议问题