Answer the question
In order to leave comments, you need to log in
How can I run a program in Eclipse so that it doesn't require input before running the code directly?
I just started learning to program in Eclipse and I don’t know at all why the console (wired) requires data input before running the code itself. Although I may have messed up in setting up Eclipse itself, I ask for help, because I don’t understand this at all.
Answer the question
In order to leave comments, you need to log in
These are manifestations of buffered output. Those. in fact, printf has already been executed before the input, but it has not yet been displayed on the screen.
Insert fflush(stdin) between printf and scanf.
Based on what I understand, the problem is in the settings of the eclipse itself. The console works as it should:
But with the same code (except for getch(), which kills eclipse for some reason), eclipse doesn't want to work properly:
Program code respectively:
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question