Mac OS上用命令行执行C程序 CodingDGSun 2021-12-30 354 阅读1分钟 用命令行新建C文件 touch hello.c 编辑C文件 vim hello.c 编写C程序代码 #include <stdio.h> int main() { printf("Hello World!"); return 0; } 编译C程序文件 cc -c hello.c 生成可执行文件 cc hello.o 执行文件 ./a.out