Need help reading data files!

Hi, so I'm having some trouble reading data files. What I need to do for my project is read in a list of names along with numbers (things like salary) beside those names. My sample data file looks like this:

Anderson Joe H 12.50 8000
Baker Sue H 10.25 6125.50
Thompson Randy S 32500 9525.00

And so on. How would I read the data file so that it collects the first name, last name, and middle initial as a string line but also corresponds the numbers to that name? I hope that makes sense.

Also, the sample data file I have has five employees on it, but I need to write my program to account for a maximum of 10. How would I make sure the program reads until the end of the file?
I would also make a struct that contains:

and just read em all in the way that Darkmaster showed.
Topic archived. No new replies allowed.