title: Why does this C code works on linux but not on Windows without cygwin
body: <p>I have a C code.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;time.h&gt;
  #include &lt;unistd.h&gt;
  int main()
  {
      int a = 1;
      while( a &lt;= 5 )
      {
  
      time_t t = time(NULL);
      struct tm tm = *localtime(&amp;t);
      printf("Normal prinf funcation call from C\n");
      fprintf(stdout, "STDOUT, Got on STDOUT from C. - now: %d-%d-%d %d:%d:%d\n", tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec);
      fprintf(stderr, "STDERR, Got in STDERR from C. - now: %d-%d-%d %d:%d:%d\n", tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec);
      sleep(1);
      a ++;
      }
      return 0;
  }
  </code></pre>
  
  <p><strong>On Linux</strong>
  I compile this C code with gcc. A binary gets generated.</p>
  
  <p>I see the following as output, when I execute the binary;</p>
  
  <pre><code>Normal prinf funcation call from C
  STDOUT, Got on STDOUT from C. - now: 2018-11-10 17:44:38
  STDERR, Got in STDERR from C. - now: 2018-11-10 17:44:38
  Normal prinf funcation call from C
  STDOUT, Got on STDOUT from C. - now: 2018-11-10 17:44:39
  STDERR, Got in STDERR from C. - now: 2018-11-10 17:44:39
  Normal prinf funcation call from C
  STDOUT, Got on STDOUT from C. - now: 2018-11-10 17:44:40
  STDERR, Got in STDERR from C. - now: 2018-11-10 17:44:40
  Normal prinf funcation call from C
  STDOUT, Got on STDOUT from C. - now: 2018-11-10 17:44:41
  STDERR, Got in STDERR from C. - now: 2018-11-10 17:44:41
  Normal prinf funcation call from C
  STDOUT, Got on STDOUT from C. - now: 2018-11-10 17:44:42
  STDERR, Got in STDERR from C. - now: 2018-11-10 17:44:42
  </code></pre>
  
  <p>On windows machine, using <strong>cygwin</strong> and <strong>gcc</strong>, I compile the same C code to a <strong>.exe</strong> file, Then try to run it in the cmd (not cygwin, works on cygwin). Nothing gets printed on the screen. </p>
  
  <p>Is there any major difference between STDOUT/STDERR on Linux and on Windows?</p>
  
  <p>How Can I make the <strong>.exe</strong> file print to command prompt(At least printf call should have worked.)?  </p>
  
  <p>P.S: I use the following command on both Linux and Windows to generate the binary/exe.</p>
  
  <pre><code>gcc C_code.c -o binary
  </code></pre>