My code is this atm:

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

int main(int argc, char *argv[]){

   int a,b,c;
   int swap;

   printf("Enter 3 Numbers (# # #):");
   scanf("%d %d %d", &a,&b,&c);

   //does all its computing, to see which one is biggest.
   return EXIT_SUCCESS;

The result when i run it in eclipse is that, I have to put in 3 numbers first, THEN it says "Enter 3 Numbers (# # #):"
(So it stays blank at start of program)
I remember I had this problem a long time ago but I have switched back to eclipse now and somehow this happens. :/
Thanks in adance.

5 Years
Discussion Span
Last Post by WaltP

Setbuffer to null at begining of main function

int main(){
    setbuf(stdin, NULL);
    setbuf(stdout, NULL);

Edited by Nick Evan: Fixed formatting


Hmm, well I have switched to code::blocks instead for now, I'm afraid I might forget to remove those statements and I will get marked down for it(since I am supposed to only use code that I have learnt during the course I am doing), anyway maybe I'll give Eclipse a go some other day. Though also which Visual Studio can be used for C Programming?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.