Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » console window of eclipse doesn´t display what I want
console window of eclipse doesn´t display what I want [message #1759519] Wed, 12 April 2017 13:53 Go to next message
Edouard Henrik is currently offline Edouard HenrikFriend
Messages: 4
Registered: April 2017
Junior Member
Hi,

I am new to eclipse and c language.
I try to program a simple hello world variation.
#include <stdio.h>
#include <stdlib.h>

int main(void) {
	puts("!!!Hello World!!!"); /* prints !!!Hello World!!! */
	getchar();
	puts("hello world returns");
	return EXIT_SUCCESS;
}


On the command window, I expect to be displayed !!!Hello World!!!, than wait until I imput a character and than when I inputted the character, it should display hello world returns.
It unfortunately doesn´t do this. It actually waits until I imput a character and then prompts !!!Hello World!!! and hello world returns together.

Why is that?
Re: console window of eclipse doesn´t display what I want [message #1759532 is a reply to message #1759519] Wed, 12 April 2017 15:30 Go to previous message
David VavraFriend
Messages: 1426
Registered: October 2012
Senior Member
The console is buffered depending on the OS.
To circumvent this, do flush(stdout) before requesting prompt input.
Previous Topic:Eclipse IDE Arduino - Cannot Program ATmega32u4
Next Topic:I/O via (Eclipse-) console buggy
Goto Forum:
  


Current Time: Tue Sep 24 22:15:39 GMT 2024

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

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

Back to the top