我正在学习使用sublime3文本编辑器编写C程序,我有两种不同的崇高版本 此版本在CMD控制台上输出它的执行;Sublime 3控制台上交互式程序的输出
> {
"cmd": ["gcc", "$file_name", "-o", "${file_base_name}.exe", "&&", "start", "cmd", "/k", "$file_base_name"],
"selector": "source.c",
"working_dir": "${file_path}",
"shell": true
}
而其它构建输出崇高控制台上其执行
> {
"cmd": ["gcc", "$file_name", "-o", "$file_base_name"],
"selector": "source.c",
"working_dir": "${file_path}",
"variants":
[
{
"name": "Run",
"cmd": ["gcc","${file}", "-o", "$file_base_name", "&&", "$file_path/$file_base_name"],
"shell":true
}
]
}
我更喜欢第二内建但是当你用它来运行非交互式程序如"Hello world"
程序它只能和它给了我
#include <stdio.h>
#include <float.h>
// variable declaration;
int main()
{
float a,b,sum;
printf("Enter value of a\n");
// for float u use "f" instead of d
scanf("%f", &a);
printf("Enter value of b\n");
scanf("%f",&b);
sum=a+b;
printf("The sum of %f and %f = %f\n",a,b,sum);
return 0;
}
错误信息:当我用它来这样运行了一个简单的互动程序错误消息
c:/mingw/bin/../lib/gcc/mingw32/5.3.0/../../../../mingw32/bin/ld.exe: cannot open output file addition.exe: Permission denied collect2.exe: error: ld returned 1 exit status [Finished in 0.3s]
我想知道我是否可以在崇高的控制台上执行交互式程序,或者我需要对我的崇高构建做些事情。