Console input problem [message #136914] |
Sun, 30 January 2005 09:06 |
Eclipse User |
|
|
|
Originally posted by: jaakko.luttinen.hut.fi
Hello,
I'm new to CDT and have a problem with the Console.
When I choose to Run my application it starts in the Console but all the
input must be entered in the beginning.
Simple code looks like following:
#include <stdio.h>
int main( void )
{
int number = 0;
printf( "Hello!\nEnter a number: " );
scanf( "%d", &number );
printf( "\nNumber was: %d", number );
return 0;
}
But the console takes the INPUT first and then shows all the output. (???)
Execution example looks like following:
3
Hello!
Enter a number:
Number was: 3
The program works fine when running it in the Command Prompt. Anyone know
how to solve this problem? I have no idea what to do..
Thank you.
-Jaakko
P.S. Another small problem: Why doesn't Console get focus when I press Run?
|
|
|
Powered by
FUDForum. Page generated in 0.02950 seconds