find the number of time a char is in a a string c++ code example Example: count a character in a string c++ count(str.begin(), str.end(), 'e')