mac 下写c程序

来源:互联网 发布:欧洲卡车模拟2优化 编辑:程序博客网 时间:2024/05/20 22:03

创建文件并进入编辑器

vim hello.c

输入代码

#include <stdio.h>int main(){    printf("hello world!");}

编译c程序

gcc hello.c

执行后会出现a.out文件
执行c程序

./a.out hello.c