how to get count of a character in a string in c++ code example Example: count a character in a string c++ count(str.begin(), str.end(), 'e')