Reading end of setence

So I'm trying to reformat a paragraph where the first letter of each sentence is capitalized and the rest are lower case. This is my function thus far. I'm trying to read for the end marks . ! and ? and have it so that once the are encountered the next word is capitalized. I used ispunct initially but it read for things like ,'s as well.

int PunctCount(string Text)
//Counts the end marks.

int Total = 0;
for (int i = 0; i < Text.length(); i++)
if (Text == '.' || Text == '?' || Text == '!')
return Total;

Right now I get error: no match for âoperator==â in âText == '!'â
In your if statements, you need to use Text[i], not just Text.
Topic archived. No new replies allowed.