Sublime Forum

Running a C program in the console - not waiting for input?

#1

I’ve written a few small programs in C that require input. Lets say its a program that asks for 2 numbers and then adds them.

When I run this program using [shift-command-B], it never asks me for my input. it just blows through the whole program!

here is what happened when I ran my quadratic equation program I wrote for school:

[quote]This program will compute the real roots of a quadratic equation.
You will be asked for (3) constants.
Enter for -a- :
Enter for -b- :
Enter for -c- : Thank you…RESULT: There are no real roots.[Finished in 0.1s][/quote]

All I did was hit [shift-command-B] and it just went nuts! why?

0 Likes

#2

Sublime Text doesn’t provide an interactive terminal. While it’s on my wish list, I don’t know how likely it is we will see it. I’d suggest you build from Sublime but use the terminal for running your program. Perhaps give wbond’s terminal plugin a try.

0 Likes