count number of chars in a string c++ code example
Example: count number of char in a string c++
string str_V;
char chr
getline(cin, str_V);
for(i=0; i<=str.length; i++)
{
if(str[i]==chr)
{
space++
}
}
string str_V;
char chr
getline(cin, str_V);
for(i=0; i<=str.length; i++)
{
if(str[i]==chr)
{
space++
}
}