qfedu-c-level/day14/d2.c

15 lines
431 B
C
Raw Permalink 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.

// 行缓冲区
// 写数据时遇到换行符,则刷新缓冲
// 如果行缓冲不刷新时,则不会输出结果。
// 因为输出的内容没有遇到换行符Linux `\n`, Window(`\r\n`)。
#include <stdio.h>
int main()
{
printf("Hello World"); // 缓冲区未写满,不会刷新缓冲区,不会输出
while (1)
;
return 0; // 缓冲未写满,不会刷新缓冲区,不会退出程序
}