我正在从教程中同时学习 C 和一般编程课程。课程设置建议 Windows 用户使用 SciTE,所以我这样做了。可能因为我有 Windows 8,我必须编辑 SciTE cpp.properties 文件才能运行示例程序。这是属性文件的 make/go 部分的样子:
ccopts=-pedantic -Os
cc=g++ $(FileNameExt) -o $(FileName).exe
ccc=gcc $(FileNameExt) -o $(FileName).exe
make.command=make
command.compile.*.c=$(ccc) -std=c99
command.build.*.c=$(make.command)
command.build.*.h=$(make.command)
command.clean.*.c=$(make.command) clean
command.clean.*.h=$(make.command) clean
command.go.*.c=$(FileName)
我的问题是我无法让这个程序在 SciTE 中执行。它在 PowerShell/cmd 中运行良好,但如果我尝试在 SciTE 中执行它,我不会得到第一个打印输出,并且提供输入什么也不做。即使我停止执行,它也永远不会结束。我必须进入任务管理器并结束程序。我以前也遇到过这个问题,但那是因为我打错了。我不知道我在这里打错了什么:
#include <stdio.h>
#include <conio.h>
int main(void)
{
int num1;
int num2;
printf("Enter 2 numbers\n");
scanf("%d%d", &num1, &num2);
if(num1 == num2) {
printf("they are equal\n");
}
if(num1 < num2) {
printf("%d is less than %d\n", num1, num2);
}
if(num1 > num2) {
printf("%d is greater than %d\n", num1, num2);
}
getch();
}