Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Wierd console behaviour for C projects.(Input, then prompts?)
Wierd console behaviour for C projects. [message #558210] Fri, 10 September 2010 14:16 Go to next message
Devon Bain is currently offline Devon BainFriend
Messages: 3
Registered: September 2010
Junior Member
So I have an interesting problem with Eclipse Galileo. I use it for Java, C++ and C programming. The first two work flawlessly: everything runs just like it should. C is where I have issues.

1.) I can't ever get it to build a binary, ever. So I've taken to using the included HelloWorld.c template and building whatever I'm doing off of that. If I use the template, everything works. If I don't, it can't build a binary. I have no idea why. C++ projects build just fine.

2.) When running C programs, it will take ALL input for the entire program (I've just been building simple stuff) BEFORE it displays any text at all. This is making it exceptionally difficult to debug my code. How do I get it to run like it does in the actual console, i.e. text, prompt, entry, execute?

Thank you all in advance, I appreciate any help you can give me. This is the first time I've really coded C, but I've developed in Java , VB and C++ for years and been using Eclipse for about a year - something I'd like to continue doing, since the other C IDEs really, really suck.

Again, my thanks!
Devon
Re: Wierd console behaviour for C projects. [message #558243 is a reply to message #558210] Fri, 10 September 2010 16:01 Go to previous messageGo to next message
Axel Mueller is currently offline Axel MuellerFriend
Messages: 1973
Registered: July 2009
Senior Member
Does this help http://wiki.eclipse.org/CDT/User/FAQ#Eclipse_console_does_no t_show_output_on_Windows

Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
Re: Wierd console behaviour for C projects. [message #558265 is a reply to message #558243] Fri, 10 September 2010 17:04 Go to previous messageGo to next message
Devon Bain is currently offline Devon BainFriend
Messages: 3
Registered: September 2010
Junior Member
Sadly, no. I see output just fine, let me see if I can make this clearer.
If I have a main with the following code:

Int main ()
{ int input;

Printf("press y then enter");
Scanf("%c", &input);
return 0;}

Then the console output in Eclipse will be blank until I enter a character and press return, at which point it will display the printf() and finish. It doesn't matter what order I list anything in, if I have it nested in a called function, whatever. The scanf functions of the entire program have to have input before ANY output is generated in console.

And I have no idea why.
Re: Wierd console behaviour for C projects. [message #558266 is a reply to message #558210] Fri, 10 September 2010 17:11 Go to previous messageGo to next message
No real name is currently offline No real nameFriend
Messages: 3
Registered: September 2010
Junior Member
You didn't actually capitalize the Printf, Scanf, and Int did you?

[Updated on: Fri, 10 September 2010 17:11]

Report message to a moderator

Re: Wierd console behaviour for C projects. [message #558267 is a reply to message #558266] Fri, 10 September 2010 17:15 Go to previous messageGo to next message
Devon Bain is currently offline Devon BainFriend
Messages: 3
Registered: September 2010
Junior Member
No. I'm replying on my mobile and it likes to capitalize every new line. I just wanted to give some sort of reference point for visualization purposes.
Re: Wierd console behaviour for C projects. [message #558308 is a reply to message #558265] Sat, 11 September 2010 00:27 Go to previous message
David Wegener is currently offline David WegenerFriend
Messages: 1445
Registered: July 2009
Senior Member
On Fri, 2010-09-10 at 13:04 -0400, Devon Bain wrote:
> Sadly, no. I see output just fine, let me see if I can make this clearer.
> If I have a main with the following code:
>
> Int main ()
> { int input;
>
> Printf("press y then enter");
> Scanf("%c", &input);
> return 0;}
>
> Then the console output in Eclipse will be blank until I enter a character and press return, at which point it will display the printf() and finish. It doesn't matter what order I list anything in, if I have it nested in a called function, whatever. The scanf functions of the entire program have to have input before ANY output is generated in console.
>
> And I have no idea why.

This is precisely the behavior that the FAQ referenced by Alex refers.
Follow the suggestions in the FAQ.
Previous Topic:Editor does not recognize some include files
Next Topic:Source-Level Debugging Issue?
Goto Forum:
  


Current Time: Fri Apr 26 10:47:45 GMT 2024

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

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

Back to the top