I need to use an infile which contains 15 lines like this data.
Firstname Lastname 1 2
I can't figure out how do I read in the first and last name as a single string and put it in an array at the same time as putting the numbers in another array. I need to count each line of data so I can bubble sort it.
Also the the number on right is supposed to represent a title {Mr,Mrs,Ms,Miss}. The title obviously stays with each person but I'm not sure if I can convert the numbers to string and combine it with the name before or after sorting.
Typically I would use something like this to read in two arrays of numbers for sorting, but it doesn't work when I add a string array. Also it's supposed to be one dimensional arrays no 2D.
1 2 3 4
count = 0;
while (!infile.eof() && infile >> seat[count] && infile
>> title [count])
count++;
Edit: So I'm able to read in all the data like this but I still want to combine the first,last name, and change the digit into a string.