title: when i call my function the while loop skips a step
body: <p>this is my code:</p>
  
  <pre><code>string getFileContents(istream&amp; file_contents){
      string line;
      getline(file_contents, line);
  
  return line;
  }
  
  project read_project(istream&amp; in){
      project newproject;
      while(cin){
          cout &lt;&lt; "Enter your project name: ";
          newproject.proname = getFileContents(cin);
  
          cout &lt;&lt; "Enter a description: ";
          newproject.prodesc = getFileContents(cin);
  
          cout &lt;&lt; "How long until deadline: ";
          newproject.protime = getFileContents(cin);
  
      promap.insert(pair&lt;string, project&gt; ( newproject.proname , newproject));
      cout &lt;&lt; endl &lt;&lt; "You created a new project: " &lt;&lt; newproject.proname
      &lt;&lt; endl &lt;&lt; "Project description: " &lt;&lt; newproject.prodesc ;
  }
  }
  
  
  
  int main(){
  
  string inputcmd;
  
  while (cin){
  cout &lt;&lt; "TYPE A COMMAND" &lt;&lt; endl;   
  cin &gt;&gt; inputcmd;
  
  if (inputcmd == "makenew")
      cout &lt;&lt; "MAKING NEW PROJECT";
      read_project(cin);
  }
  return 0;
  </code></pre>
  
  <p>my objective is to successfully store a project type in a map. the user first enters a 'command' "makefile", this calls a read_project function, which both operate with cin as a parameter. the problem is when i run the code it gives strange outcome, like the first time i type makefile and it skips the "enter your project name: " and does right for the "enter your project description". why does it do that? on all the succeeding loops it works correctly, first asking for the project name and waiting for the input.</p>