Files
Linux-C-Notes/C13-IO/stdio/fflush.c
2024-05-27 02:33:10 +08:00

20 lines
307 B
C
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char **argv)
{
int i;
// 这里不加\n的话什么都不输出
// 要么加\n要么fflush
printf("Before while()");
fflush(stdout);
while (1)
;
printf("After while()");
fflush(NULL);
exit(0);
}