Counting number of vowels in a string
using STL
1 2
|
string str("SHADOWCODE");
transform(str.begin(), str.end(), str.begin(), tolower);
|
or
1 2 3
|
string str("SHADOWCODE");
for(int i = 0; i < str.length(); i++)
str.at(i) = tolower(str.at(i));
|
Topic archived. No new replies allowed.