title: C++ how to check if cin does not equal something in a while loop condition?
body: <p>I am trying to learn file i/o in c++. I have a bunch of variables like kill, death, assist, result, notes and I want to enter them into a text file. I have seen tutorials where they use cin inside a while loop like </p>
  
  <pre><code>while ( cin &gt;&gt; kill &gt;&gt; death &gt;&gt; assist ) {
  file &lt;&lt; kill &lt;&lt; death &lt;&lt; assist ; }
  </code></pre>
  
  <p>but I want the user to type in "done" when they are done entering their input.
  I know in python you can do something like </p>
  
  <pre><code>while (input != "done" ):
       //code//
  </code></pre>
  
  <p>can I do something similar?</p>
  
  <pre><code>while ( cin &gt;&gt; () != "done" ) {
  cin &gt;&gt; kill &gt;&gt; death &gt;&gt; assist &gt;&gt; notes ;
  file &lt;&lt; kill &lt;&lt; death &lt;&lt; assist &lt;&lt; notes ; }
  </code></pre>