0

I have just started running on Eclipse and I seem to be having a problem with printf() statements. I ran a basic piece of code that worked in Notepad++, but doesn't seem to be doing the same in Eclipse. After compiling and running the program, nothing seems to be printed in the console below. Is there something wrong with my code, with the IDE, or something else?

#include<stdio.h>


int main (void)
{
    printf("Hello world");
    fflush(stdout);

    return 0;
}
QuayShawn
  • 75
  • 1
  • 8

1 Answers1

2

This link might help

Why does printf not flush after the call unless a newline is in the format string?

Try adding '\n' in printf.

printf("Hello world\n");
Community
  • 1
  • 1
Gopi
  • 19,499
  • 4
  • 21
  • 35
  • 1
    Thanks for the suggestion, but still no luck. Even with the \n added, the console still comes out empty after running. – QuayShawn Nov 01 '14 at 18:29
  • setvbuf (stdout, NULL, _IONBF, 0); Try adding this before printf if you still have issues.http://stackoverflow.com/questions/13035075/printf-not-printing-on-console – Gopi Nov 02 '14 at 17:05