1)工具-编译系统-新建编译器
{
"cmd" : ["gcc -o ${file_base_name} $file_name"],
"shell" : true,
"working_dir" : "$file_path",
"selector": "source.c",
"encoding":"utf-8",
"variants" :
[{
"name" : "Run",
"cmd" : "./${file_base_name}"
}]
}
2)编写程序
#include <stdio.h>
int main()
{
printf("hello world");
}
- command+b 编译运行程序