Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » A newbie problem(somthing about console window output)
A newbie problem [message #845792] Sun, 15 April 2012 12:33
Sen Wang is currently offline Sen WangFriend
Messages: 2
Registered: April 2012
Junior Member
Hi I'm have a problem about console window output
Here's my code:
#include <stdio.h>
#include <stdlib.h>

int main(void)
{
char str1[20], str2[20];

scanf( "%s", str1 );
printf( "%s\n", str1 );

scanf( "%s", str2 );
printf( "%s\n", str2);

return EXIT_SUCCESS;
}

While I'm running this I entered:
First
and nothing happened, then I entered:
Second
at the end I got:
First
Second
First
Second

That's not I expect, and it's weird for me.
How can I get the normal ordered console?
Previous Topic:build and run
Next Topic:Galileo CDT under (K)Ubuntu 10.04 won't install
Goto Forum:
  


Current Time: Mon Dec 22 04:27:16 GMT 2014

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

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