title: Why is std::getline() skipped?
body: <p>I have this C++ simple program;</p>
  
  <pre><code>#include &lt;iostream&gt;
  using std::endl;
  using std::cout;
  using std::cin;
  using std::getline;
  
  #include &lt;string&gt;
  using std::string;
  
  
  struct Repository
  {
      string name;
      string path;
      string type;
      string command;
  };
  
  
  int main()
  {
      Repository rp;
  
      cout &lt;&lt; "\nEnter repo name: ";
      cin &gt;&gt; rp.name;
  
      cout &lt;&lt; "Enter repo path: ";
      cin &gt;&gt; rp.path;
  
      cout &lt;&lt; "Enter repo type: ";
      cin &gt;&gt; rp.type;
  
      cout &lt;&lt; "Enter repo command: ";
      getline(cin, rp.command);
  
      cout &lt;&lt; "\nRepository information: " &lt;&lt; endl;
      cout &lt;&lt; rp.name &lt;&lt; "\n" &lt;&lt; rp.path &lt;&lt; "\n" &lt;&lt; rp.type &lt;&lt; "\n" &lt;&lt; rp.command &lt;&lt; endl;
  
      return 0;
  }
  </code></pre>
  
  <p>When execution reaches getline(cin, rp.command) the program just print "Enter repo command: " and skips the getline(cin, rp.command) line so that the user is not given time to respond. What could be the possible problem?</p>