首页 > 解决方案 > C 程序在 MacOS 中启动缓慢

问题描述

我正在学习 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;
}

来源:https ://www.cs.princeton.edu/courses/archive/fall02/cos126/assignments/hello-osx.html

gcc hello.c然后在使用then编译并运行它./a.out 似乎在我看到之前有一个暂停Hello world! Give me an integer:./a.out然后点击返回。

为什么呢?以及如何改进这家初创公司?

标签: cgccmacos-mojave

解决方案


推荐阅读