Re: Problem with eclipse and a simple c program



lionelgreenstreet@xxxxxxxxx wrote:
I have some problems when this simple program run with eclipse:

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



int main()
{
int number;
printf("Enter a number\n");
scanf("%d", &number);
printf("You entered %d", number);
return 0;
}

In run mode on consolle nothing appear, "enter a number" appears only
after the inserction of a number and not before. Why?
Thanks

When I run this from a console it works correctly here
(windows vista 64/ lcc-win compiler)

Maybe in some systems you have to write
fflush(stdout);
after the printf statement. Try that.


--
jacob navia
jacob at jacob point remcomp point fr
logiciels/informatique
http://www.cs.virginia.edu/~lcc-win32
.



Relevant Pages

  • Re: new order doubt
    ... Warning test2.c: 8 no type specified. ... Defaulting to int ... Even Microsoft has problems with this obscure rules. ... jacob at jacob point remcomp point fr ...
    (comp.lang.c)
  • Re: strtod strange behaviour
    ... int main ... char *p = NULL; ... printf("%s converted is %g\n", szValue, a); ... jacob at jacob point remcomp point fr ...
    (comp.lang.c)
  • Re: size_t problems
    ... strlen's result to an int is clearly wrong; strlen yields size_t, ... but that does not make him a troll. ... Now, I sometimes disagree with Jacob, but I think he makes an honest ...
    (comp.lang.c)
  • Re: similar Perl data structure?
    ... In Perl, I just read them into an array, ... int EXPORT fggets ... error code if an error happened. ... jacob at jacob point remcomp point fr ...
    (comp.lang.c)
  • Re: which tutorial to use?
    ... If the compiler is sensible it will keep int 32 bits, ... The problem is that if you put int to 64 bits you have a BLOAT ... of the size of all structures, and your program slows down ... jacob at jacob point remcomp point fr ...
    (comp.lang.c)