title: C/C++ output streams are not working in my Ubuntu 14.4
body: <p>Ubuntu 14.4; g++/gcc 4.8.2</p>
  
  <p>Here is my c++ code:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;fstream&gt;
  using std::cout;
  using std::endl;
  using std::flush;
  using std::ofstream;
  
  #include &lt;cstdio&gt;
  
  int main()
  {
    ofstream oStrm("TestCpp.txt");
    FILE *pStrm;
  
    //
    // C++ tests
    //
    cout &lt;&lt; "test" &lt;&lt; endl &lt;&lt; flush;
    cout.flush();
  
    oStrm &lt;&lt; "test" &lt;&lt; endl &lt;&lt; flush;
    oStrm.flush();
  
    oStrm.close();
  
    //
    // C tests
    //
    printf("test! \n");
  
    pStrm = fopen("TestC.txt", "w");
  
    fprintf(pStrm, "test \n"); 
  
    fflush(NULL);
  
    fclose(pStrm);
  
    return 0;
  }
  </code></pre>
  
  <p>I compile & link it with:<br>
  g++ -g -lm -o test main.cpp</p>
  
  <p>When I run this in my debugger (nemiver v0.9.5) it works as expected:<br>
  stdOut:<br>
  test<br>
  test!</p>
  
  <p>textCpp.txt:<br>
  test</p>
  
  <p><p>textC.txt:<br>
  test</p>
  
  <p><p>But when I run it from my bash shell, I get nothing.  No output files. No output to stdout.  I suspected stream buffering, but my various attempts at flush() &amp; fflush() didn't help.  I must be missing something obvious.<br>
  Any ideas?</P></p>