title: C++11 : cin doesn't wait for user input and ends the loop
body: <p>My program takes user data as a <code>tuple</code> and stores it into a <code>vector</code>. There is no limit to how many <code>tuple</code>s can be added and <code>vector</code> size changes with the adding of <code>tuple</code>s. The program asks the user if they want to add another <code>tuple</code>. If no, the loop exits. </p>
  
  <p>My problem is, when the program was supposed to wait for 'yes' or 'no' input, it skipped the cin and exited the loop.</p>
  
  <p>I have tried searching for solutions, tried clearing the buffer but I am back to square one.</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;string&gt;
  #include &lt;tuple&gt;
  #include &lt;vector&gt;
  using namespace std;
  
  void print(vector&lt;tuple&lt;int, string, string, bool&gt;&gt; const &amp; data)
  {
      if (data.size() != 0)
      {
          for (auto row : data)
          {
              cout &lt;&lt; get&lt;0&gt;(row) &lt;&lt; ", " &lt;&lt; get&lt;1&gt;(row) &lt;&lt; ", " &lt;&lt; get&lt;2&gt;(row)
                   &lt;&lt; ", " &lt;&lt; get&lt;3&gt;(row) &lt;&lt; endl;
          }
      }
      else
      {
          cout &lt;&lt; "\nNO ENTRIES CURRENTLY!";
      }
  }
  int main()
  {
      int id;
      char go;
      string name, filePath;
      bool flag = false;
      typedef tuple&lt;int, string, string, bool&gt; pData;
      vector&lt;pData&gt; pList;
  
      do
      {
          cout &lt;&lt; "Enter a Pattern Call:" &lt;&lt; endl;
          cin &gt;&gt; id &gt;&gt; name &gt;&gt; filePath &gt;&gt; flag;
  
          pList.push_back(make_tuple(id, name, filePath, flag));
  
          cout &lt;&lt; "Do You wish to add another: ";
          cin.ignore();
          cin &gt;&gt; go; //The control skips here and exits the loop.
      } while (go == 'y' || go == 'Y');
  
      print(pList);
  
      return 0;
  }
  </code></pre>