title: C++ Populating a vector of objects with user input
body: <p>I am new to vectors and new to classes.That being said, I have found some posts about how to create a vector of objects. I want to know how would one go about creating a vector of objects from user input? Say the program asks the user to give the number of employees(class) he/she wants to create. The user wants to add 5 employees. So user must input the employee's last name and first name. I have a for loop in mind but I am not sure how to go about grabbing the user input (Maybe using getline and push_back?) and storing it in the vector. </p>
  
  <pre><code>//Lets say class.h looks like this
  class Employee
  {
  private:
      string lastName;
      string firstName;
  public:
      void setLastname(string);
      void setFirstname(string);
      string getLastname() const;
      string getFirstname() const;
  }
  </code></pre>