系统编程文件部分
This commit is contained in:
20
Chapter13/io/stdio/fflush.c
Normal file
20
Chapter13/io/stdio/fflush.c
Normal file
@@ -0,0 +1,20 @@
|
||||
#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);
|
||||
}
|
||||
Reference in New Issue
Block a user