title: Why my cmd disapears? I use cin.ignore() but it has no effect! C++
body: <p>I'm testing my roulette classes but visual studio don't let me see the output since <strong>cin.ignore()</strong> does not work, and I have no idea what going on here,</p>
  
  <p>can you explain why my cmd line window disapear and why <strong>cin.ignore()</strong> in this code never gets invoked?</p>
  
  <p>Thank you so much!</p>
  
  <pre><code>#include "Bet.h"
  #include "Table.h"
  #include &lt;iostream&gt;
  
  using namespace std;
  using namespace Roulette;
  
  
  int main()
  {
      cout &lt;&lt; "Enter numbers for Split bet:" &lt;&lt; endl;
      short answer;
      vector&lt;short&gt;* Selection = new vector&lt;short&gt;;
      for (short i = 0; i &lt; 2; ++i)
      {
          cin &gt;&gt; answer;
          Selection-&gt;push_back(answer);
      }
  
      cout &lt;&lt; "Enter how many chips and chip worth:" &lt;&lt; endl;
      short chips, worth;
      cin &gt;&gt; chips &gt;&gt; worth;
  
      Bet* MyBet = new Bet(TableLayout::European, BetName::Split, chips, worth, Selection);
  
      Bet* Complex = new Bet(TableLayout::European, BetName::VoisinsDeZero, 1, 1);
  
      Complex-&gt;PrintProperties();
  
      cin.ignore(); // THIS IS IGNORED!!! WHY??? please...
  
      delete Selection;
      Selection = nullptr;
      delete Complex;
      delete MyBet;
      return 0;
  }
  </code></pre>
  
  <p>EDIT:</p>
  
  <p>I press F5 to run a program and then type in the numbers as follows:</p>
  
  <p>1 enter
  2 enter
  1 enter
  1 enter</p>
  
  <p>and here cmd goes away, program skips cin.get() ( or cin.ignore() ) whatever it doesn't work.</p>