Trying to keep age/name pairs matched after sorting
<p>I'm writing a program where the user inputs names and then ages. The program then sorts the list alphabetically and outputs the pairs. However, I'm not sure how to keep the ages matched up with the names after sorting them alphabetically. All I've got so far is...</p>

<p>Edit: Changed the code to this -</p>

<pre><code>#include "std_lib_facilities.h"

struct People{
       string name;
       int age;
};

int main()
{
    vector&lt;People&gt;nameage;
    cout &lt;&lt; "Enter name then age until done. Press enter, 0, enter to continue.:\n";
    People name;
    People age;
    while(name != "0"){
                 cin &gt;&gt; name;
                 nameage.push_back(name);
                 cin &gt;&gt; age;
                 nameage.push_back(age);}
    vector&lt;People&gt;::iterator i = (nameage.end()-1);
    nameage.erase(i);    
}
</code></pre>

<p>I get compiler errors for the != operator and the cin operators. Not sure what to do.        </p>
