title: Cin.Ignore() is not working
body: <p>Here I have a code:</p>
  
  <pre><code>cout &lt;&lt; "Press Enter To Exit...";
  cin.ignore();
  </code></pre>
  
  <p>this program will execute and will wait till you press enter and then it will exit.
  now see this code:</p>
  
  <pre><code>int m;
  cin &gt;&gt; m;
  cout &lt;&lt; "Press Enter To Exit...";
  cin.ignore();
  </code></pre>
  
  <p>this time after entering a number for saving in "m" the program will exit without waiting for cin.ignore command which waits for pressing enter.</p>
  
  <p>I mean if you use cin command before cin.ignore, the cin.ignore command will skip. why? and what should I do for fixing it?</p>