title: C++ How check characters in real time with _getch()
body: <p>i need in my loop get character in realtime and check it by conditions. If user press whatever except enter, program works fine. Can anyone help me ? thanks !</p>
  
  <pre><code>   while (read != '\n')
              {
                  cout &lt;&lt; "Enter character:\n";
                  read = _getwch();
                  if (read == '\n') {
                      cout &lt;&lt; "You pressed : ENTER\n";
                  }
                  else {
                      cout &lt;&lt; "Your character is: \"" &lt;&lt; read &lt;&lt; "\"\n\n";
                      read = '\0';
                  }
              }
  </code></pre>