在这个问题中我学习了如何使用 Sublime Text 2 编译 C 程序:
How to compile and run a simple C program with Sublime Text 2?
如何让程序在 Sublime Text 2 中运行?
最佳答案
编辑构建文件以添加运行程序的命令。您可以通过按 ctrl+~ 在 ST 控制台中查看程序的输出。
{
"cmd" : ["gcc", "$file_name", "-o", "${file_base_name}.exe", "&&", "${file_base_name}.exe"],
"selector" : "source.c",
"shell" : true,
"working_dir" : "$file_path"
}
作为替代方案,您可以创建一个 shell 脚本或 Makefile 来编译并运行该文件,然后从 ST 构建命令调用该脚本或 make。
关于c - 如何在 Sublime Text 2 中运行 C 程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11895400/