title: Combining Two Strings into One Variable in C++
body: <p>I am en process of writing a simple program that assigns given student names into groups of whatever interval requested. Currently, I am focusing on the function that reads the name of the students.
  Here is the code:</p>
  
  <pre><code>class student
  {
  public:
      string nameFirst;
      string nameLast;
  };
  
  student typeName()
  {
      student foo;
      cout &lt;&lt; "Type in a student's first name: ";
      cin &gt;&gt; foo.nameFirst;
      cout &lt;&lt; "Type in that student's last name: ";
      cin &gt;&gt; foo.nameLast;
      cout &lt;&lt; "\n";
      return foo;
  }
  </code></pre>
  
  <p>Since I cannot use <code>getline()</code>, I am forced to create two strings, one for each section of the student's full name. How can I rewrite this code to allow for it to take the full name without creating two variables and without using <code>getline()</code>? Or, if such isn't possible, how can I use a method within the class to combine the two strings into one?</p>