Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Output's order problem
Output's order problem [message #1781627] Fri, 09 February 2018 16:24 Go to next message
Mario Rossi is currently offline Mario RossiFriend
Messages: 2
Registered: February 2018
Junior Member
Hi,

i've got some problems with a simple code like this:

#include <stdio.h>
#include <stdlib.h>

int main(void) {
int x;
printf("Inserisci valore:");
scanf("%d",&x);
printf("Valore stampato: %d",x);

}

I need to insert a number before to see the first printf..

OUTPUT:
2//a random number insert by me
Inserisci valore: Valore stampato: 2

My os is Win10.
I use MinGW.
I have the latest versione of Eclipse oxygen.
I edit the Hello world example.
I have already installed java sdk and java jre.
I've already tried to unistall and re-install both java and eclipse.

Re: Output's order problem [message #1781641 is a reply to message #1781627] Sat, 10 February 2018 04:10 Go to previous messageGo to next message
David VavraFriend
Messages: 1426
Registered: October 2012
Senior Member
Use fflush(stdout) to flush the output buffer after your prompt.
You may also need to append \n to your prompt
Re: Output's order problem [message #1781647 is a reply to message #1781641] Sat, 10 February 2018 12:11 Go to previous message
Mario Rossi is currently offline Mario RossiFriend
Messages: 2
Registered: February 2018
Junior Member
Oh god, it works! Thanks a lot!
Previous Topic:C to MIPS Converter
Next Topic:Eclipse Debugger Issue
Goto Forum:
  


Current Time: Wed Apr 24 23:59:01 GMT 2024

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

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

Back to the top