title: getch() inside while loop always returns 1
body: <p>I'm trying to use "ch" variable after I catch it with getch() function from expression inside a loop. I can't use it at all because it always returns the same char code (1 as int). I know I can just simply use while(1) and make working getch() from there, but it is considered bad practice and I wonder why it just doesn't work this way.</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;conio.h&gt;
  
  int main()
  {
      while (char ch = getch() != 'q')
      {
          std::cout &lt;&lt; ch;
      }
  }
  </code></pre>
  
  <p>I'm using code::blocks 13.12 with GNU GCC Compiler</p>
  
  <p>by the way.. this doesn't work too</p>
  
  <pre><code>int main()
  {
      char ch;
      while (ch = getch() != 'q')
      {
          std::cout &lt;&lt; ch;
      }
  }
  </code></pre>