I think you imagine this is more difficult than it is. I just did this program myself (though I did it in Perl where it is only about 3 lines long). The trick is something called an associative array. C++ calls these
maps.
all that you really need is to include the
cctypes header which has the nice isalpha() function which you can use to tell if this is an alphabetical character. Then you just the map to keep track of the frequency of each letter.
so you need something like this (note this code is not compiled and more than likey has some typos):
CODE
#include <iostream>
#include<map>
#include <cctype>
#include <string>
using namespace std;
int main() {
map<char, int> chars;
string input;
cout << "Enter a string to count: ";
cin >> input;
for (int i = 0; i < input.length(); i++) {
if (isalpha(input[i])) {
chars[input[i]]++; //add one
}
}
//do something with the data here...
return 0;
}