以下C程序不会在屏幕上打印任何内容.
我编译了程序gcc
:
#include<stdio.h>
main()
{
printf("hai");
for(;;);
}
Run Code Online (Sandbox Code Playgroud)
最有可能的stdout
是行缓冲.您的程序不会调用fflush
或发送换行符,因此缓冲区不会被写出来.
#include <stdio.h>
int main(void) {
printf("hai\n");
for(;;)
;
return 0;
}
Run Code Online (Sandbox Code Playgroud)
另见问题12.4以及main()的正确声明是什么?在C FAQ中.
归档时间: |
|
查看次数: |
480 次 |
最近记录: |