I/O via (Eclipse-) console buggy [message #1759450] |
Tue, 11 April 2017 18:25 |
Ralf Steinhaeusser Messages: 1 Registered: April 2017 |
Junior Member |
|
|
Hey folks!
I just wanted to dive into C/C++ development and installed eclipse and mingw on my PC (Win7 64 bit).
When I do very simple things like
printf("Please enter a number: ");
char word[256];
fgets(word, sizeof(word), stdin);
and I start the binary from the explorer, a command shell shows up and everything acts as it should, but when start the program from the IDE, nothing happens in the so called "interactive console".
I first have to enter something and then the text "Please enter..." appears (afterwards!).
Or this code:
for (int i=0; i<5; i++) {
Sleep(1000);
int data = rand() % 6;
printf("Val %d = %d\n", i, data);
}
Doesn't show up until the program finishes. In the windows command shell it works.
Asking Google it appears that Eclipse redirects the console output and ,,, eerh, I didn't understand the rest.
I now tried Visual Studio, and they pop up a "normal" command shell, and everything works fine. Any chance to fix Eclipse on that (very basic) topic?
Thanks,
Ralf
|
|
|
|
Powered by
FUDForum. Page generated in 0.03477 seconds