So I have been trying to make a C++ program that converts the first letter of each word in a string to uppercase. let's say if I start with "my name is john", the program should give back "My Name Is John". I have the following code but visual studio keeps talking about an assertion error or something, can someone tell me the problem with my code or give me an alternative solution? Please
"talking about an assertion error or something" is a pretty vague description of the error message. Next time copy and paste the entire message.
But it's probably complaining about your loop. You start a at 0 and then try to access sentence[a - 1], which doesn't exist. You should start that loop at 1 since you've already dealt with element 0 anyway.