I'm not sure if I need to use a delimiter or something to tell the program when to stop at each part (gender, first name, last name, etc). Could I use the getline function with ifstream? I'm having trouble implementing that in my own code. I'm not really sure where to start as I haven't had to use anything like this for a while now. Frantically searching through textbooks and Google to find similar problems, but so far I haven't had much luck. I will update my post with any questions and code that I discover.

You could also use a flag like bool maleFlag and bool femaleFlag, and set them to true and false as and when you read only 'M' or 'F' on a line, so you know what gender to associate to the names that follow.