Addition of character frequency analysis in C++