title: Cout and Cin in Linux - can't see the console
body: <p>I just moved from Windows to Linux and I'm try to create a simple application that opens a console, displays a message and wait for key press to close. I have created it on Windows and it works, then I just moved the files to Linux. Didn't make any change, just compiled it with g++ and I get no errors. The problem is that on Linux (Ubuntu 12.04) I can't see the console and some message asking me to press any key before closing. My code is as simple as this:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;cstdio&gt;
  
  int main() {
      cout &lt;&lt; "Writing file...\n";
  
          FILE *myfile = fopen("testfile.txt", "w");
          fwrite("test", sizeof(char), 4, myfile);
          fclose(myfile);
  
      cout &lt;&lt; "Press any key to exit...\n";
      cin.ignore();
      return 0;
  }
  </code></pre>
  
  <p>On Windows, when I start the executable, the console windows will show me the messages and close when pressing any key. On Linux, when I execute the program I don't get anything. It does create the testfile.txt file and insert the text, so <em>cstdio</em> related functions does work, but I can't see any console with those messages and I don't understand why. Maybe I don't know how to open a simple executable on Linux. What I want is to double click on it and see a console with two simple messages. What do you thin I'm doing wrong? Thanks!</p>
  
  <p>Also, I use g++ to compile the cpp file: <code>g++ -Wall -s -O2 test.cpp -o test</code></p>