title: Read a line from the console
body: <p>I am reading several string such as name , surname , student number and grades, the first three  I have done as follows:</p>
  
  <pre><code> cout&lt;&lt;"Enter the student's first name: "&lt;&lt;endl;
              string name;
              cin&gt;&gt;name;
              cout&lt;&lt;"Enter the student's last name: "&lt;&lt;endl;
              string surname;
              cin&gt;&gt;surname;
              cout&lt;&lt;"Enter the student's unique student number: "&lt;&lt;endl;
              string studentNo;
              cin&gt;&gt;studentNo;
  </code></pre>
  
  <p>How grades are enter in the following manner : " 90 78 65 33 22"  and I want read the entire line of grade into a string variable. All these  string are used to construct student object.</p>
  
  <p>How would I achieve this, I tried using getline() but this does not work.</p>
  
  <p><strong>My attempt:</strong></p>
  
  <pre><code> int main(){
  
  cout&lt;&lt;"Enter the student's first name: "&lt;&lt;endl;
                  string name;
                  cin&gt;&gt;name;
                  cout&lt;&lt;"Enter the student's last name: "&lt;&lt;endl;
                  string surname;
                  cin&gt;&gt;surname;
                  cout&lt;&lt;"Enter the student's unique student number: "&lt;&lt;endl;
                  string studentNo;
                  cin&gt;&gt;studentNo;
                  string classRcd;
                 std::getline(cin , classRcd);
                 db.add_student( name , surname , studentNo , classRcd); 
      /*Creates a student object and add it to a list in db which is of type database*/
                 clear();  //clears the screen in a while loop
    return 0;
  }
  </code></pre>