title: Access violation error when using QTextStream to read from console
body: <p>I have problem, got <strong>access violation</strong> when trying to use QTextStream for data reading or writing to console:</p>
  
  <blockquote>
    <p>First-chance exception at 0x77BD1D76 (ntdll.dll) in ApplicationStub.exe: 0xC0000005:<br> Access violation writing location 0x00000014.</p>
    
    <p>Unhandled exception at 0x77BD1D76 (ntdll.dll) in ApplicationStub.exe:
    0xC0000005: <br>Access violation writing location 0x00000014.</p>
  </blockquote>
  
  <p><strong>My program is simple:</strong> </p>
  
  <pre><code>#include &lt;QtWidgets/QApplication&gt;
  #include &lt;iostream&gt;
  #include &lt;QTextStream&gt;
  #include &lt;stdio.h&gt;
  
  using namespace std;
  
  int main(int argc, char *argv[])
  {
  
          QApplication app(argc, argv);
  
          ///////////////////////////////////////////////CONSOLE
  
          QTextStream out(stdout);
          out &lt;&lt; "Please enter login username and password\n";
          out.flush();
  
  
          QTextStream in(stdin);
          QString line;
          in &gt;&gt; line;
  
          return app.exec();
  
  }
  </code></pre>
  
  <p>What could be the problem? 
  Thanks</p>
  
  <p><strong>Edit 1</strong>
  I also tried QCoreApplication
  I am using Visual studio 2013, Windows 7 </p>
  
  <p>Also in my <strong>.pro</strong> file I have:</p>
  
  <pre><code>QT += console
  QT += core gui
  </code></pre>
  
  <p>I have there gui for gui option, i think this should be ok.</p>