count a character in a string c++

C++
count(str.begin(), str.end(), 'e')
Source

Also in C++: