Skip to main content



      Home
Home » Language IDEs » C / C++ IDE (CDT) » Console input problem
Console input problem [message #136914] Sun, 30 January 2005 09:06
Eclipse UserFriend
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?
Previous Topic:Debugging shared objects - breakpoints dont work
Next Topic:CDT & Run
Goto Forum:
  


Current Time: Sun Jun 08 01:48:27 EDT 2025

Powered by FUDForum. Page generated in 0.02950 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top