Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » C programs don't run in interactive mode in CDT
icon8.gif  C programs don't run in interactive mode in CDT [message #851731] Sat, 21 April 2012 08:29 Go to next message
DBTuner Stanley is currently offline DBTuner Stanley
Messages: 1
Registered: April 2012
Junior Member
Hi Guys....I just wrote a simple C program to check if the newly installed CDT works...Though I am able to execute the C program successfully, I find the behaviour different from other IDEs. The below program should print on console first and then take inputs. However, when i run the program in CDT, it takes input first and then prints it....

#include<stdio.h>

int main()
{
char name[80];
char name2[80];
printf("hello\n");

printf("hello second\n");

scanf("%s",name);

printf("You entered %s\n",name);

scanf("%s",name2);

printf("name2=%s\n",name2);

return 0;
}

output console:

peter
parker
hello
hello second
You entered peter
name2=parker

Is there any configuration setting required to correct this behaviour? I would like to make this output behave interactively just like other C compilers/IDEs. Please advise for the same.Thanks.
Re: C programs don't run in interactive mode in CDT [message #852130 is a reply to message #851731] Sat, 21 April 2012 18:06 Go to previous messageGo to next message
Klaus Mr is currently offline Klaus Mr
Messages: 117
Registered: November 2011
Senior Member
http://wiki.eclipse.org/CDT/User/FAQ#Eclipse_console_does_not_show_output_on_Windows

regards,
Klaus


icon7.gif  Re: C programs don't run in interactive mode in CDT [message #894635 is a reply to message #852130] Mon, 09 July 2012 21:50 Go to previous message
Don Kirkwood is currently offline Don Kirkwood
Messages: 1
Registered: July 2012
Junior Member
Klaus' assistance and code were VERY helpful!
Previous Topic:Incorrect class member indentation influenced by base class specifier
Next Topic:Eclipse CDT errror
Goto Forum:
  


Current Time: Sun Oct 26 03:14:26 GMT 2014

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

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