title: Segmentation fault on vector pushback
body: <p>I'm trying to fill a vector with strings of user input and every time I run the program and call the function I get a segmentation fault no matter what I input. I'm fairly inexperienced and any input is appreciated. The issue is in my entry() function, every time I try to input a string my program crashes. I'd like to know why I see a segmentation fault at the same location every time. Am I missing something obvious?</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;iomanip&gt;
  #include &lt;string&gt;
  #include &lt;vector&gt;
  #include &lt;algorithm&gt;
  
  class Interface   
  {
  private:
      std::vector&lt;std::string&gt; storage;
      std::vector&lt;bool&gt; flag;
  int i;
  std::string temp;
  //temp
  int t;
  public:
  void entry();
  void display();
  void remove();
  void complete();
  void exit();
  void recursiveBonus();
  
  };
  
  void Interface::entry()
  {
  i = 0;
  do
  {
      std::cout &lt;&lt; "Please enter a task:" &lt;&lt; std::endl;
      getline(std::cin, temp);
      storage.push_back(temp);
      flag.push_back(false);
      i++;
  }while(storage[i] != " ");
  };
  </code></pre>