MacOS中的C程序慢启动
我正在学习c编程教程,这是一个非常简单的c文件MacOS中的C程序慢启动,c,gcc,macos-mojave,C,Gcc,Macos Mojave,我正在学习c编程教程,这是一个非常简单的c文件hello.c: #include <stdio.h> int main(void) { int num; printf("Hello world! Give me an integer:\n"); scanf("%d", &num); printf("Thanks! I've always been fond of %d.\n", num); return 0; } #包括 内部主(空
hello.c
:
#include <stdio.h>
int main(void) {
int num;
printf("Hello world! Give me an integer:\n");
scanf("%d", &num);
printf("Thanks! I've always been fond of %d.\n", num);
return 0;
}
#包括
内部主(空){
int-num;
printf(“你好,世界!给我一个整数:\n”);
scanf(“%d”和&num);
printf(“谢谢!我一直喜欢%d.\n”,num);
返回0;
}
资料来源:
然后使用gcc hello.c
然后/a.out
在我看到《你好,世界》之前,似乎有一个停顿!给我一个整数:从/a.out
开始,然后点击return
为什么会这样?如何改进这一启动?这与C代码无关。它必须与操作系统加载和启动程序所需的时间有关。我认为这个问题不属于stackoverflow。也许是个更好的地方,但我不确定这和C代码无关。它必须与操作系统加载和启动程序所需的时间有关。我认为这个问题不属于stackoverflow。也许是个更好的地方,但我不确定