Okay, so my teacher wants us to have the first name and last name in alphabetical order print out. I am getting the first one, Angie, to print out...but I cannot get the last one, Zach, to print. All I am getting is aaaaa. Can someone help?
Here is the list in my SetOne.txt
John
Mary
Tom
Susan
Bill
Angie
Zach
Larry
Paul
Carl
while (!inputFile.eof())
{
if (name > lastStudent)
lastStudent = name;
}
This loop never gets executed because the inputFile is at eof after the previous loop. You should do the check for the lastStudent in the previous loop as well and scrap this one.