c - Console program does not execute correctly when run from SciTE -
i'm learning c tutorial concurrently general programming course. course setup advised windows users use scite, did. possibly because have windows 8, had edit scite cpp.properties file sample programs run. make/go section of properties file looks like:
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)
my problem cannot 1 program execute in scite. works fine in powershell/cmd if try execute in scite, don't first printout , providing input nothing. never ends, if stop executing. have go task manager , end program. have had problem before, because mistyped. don't know i've mistyped here:
#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 equal\n"); } if(num1 < num2) { printf("%d less %d\n", num1, num2); } if(num1 > num2) { printf("%d greater %d\n", num1, num2); } getch(); }
scite's output pane not regular console expect - can not ask user input in scite's output pane.
however can perhaps make use of parameters , change script accept parameters instead user input.
another option use of other default subsystem go command:
command.compile.*.c=gcc $(filenameext) -o $(filename).exe command.go.*.c="$(filedir)\$(filename).exe" command.go.subsystem.*.c=2
you can paste block @ end of cpp.properties
if wish try it. more if go command compiles on fly , executes, append line above block:
command.go.needs.*.c=gcc $(filenameext) -o $(filename).exe
side note: can terminate running scite program ctrl+break
or "tools > stop executing" menu command.
Comments
Post a Comment