I've been struggling with this code for quite a while now.
the assignment is to read a data file with a list of names, capitalize the first character of the first and last name by making an array and subtracting 32 from the character, and then outputting the names onto the screen.
this allows me to read a name, and capitalize the first letter of the first name. however, I cannot figure out how to capitalize the first letter of the last name. please help!!
If structure of the file is fixed you can use std::string::find() to find space char and change 1 char after it but that wouldn't be as nice as token solution.
Try this:
1. Check if the first token is the first letter in the line. If it is capitalize it.
2. Check if the token is empty ' '. If it is, capitalize the next token.