I need to input data from a file and then output it sorted two different ways: one way sorted by name with no numbers, the other way sorted by number with the name included. By "output" I mean have it show on the screen, not output to a new .txt document.
The information in the .txt for us to access should have the following information:
Luke 48
Josey 25
Jeremy 36
The final output should look like this:
Sorted by Name:
Jeremy
Josey
Luke
Sorted by Age:
Josey 25
Jeremy 36
Luke 48
I just can't seem to get it to work properly. So far what my code looks like is this:
Any assistance would be greatly appreciated. I know I'm doing something wrong, I just can't figure out what.
Please note my knowledge in C++ is still not very good! I have the basics and I've aced every project so far but something with this one is really holding me up.