count and display unique characters

I am trying to display the unique characters in a string and count how many times each character appears in the string. my count starts at 0 and just increases to the same amount as characters in my string and every character is displayed how do i fix this? Please help?

1
2
3
4
5
6
7
8
9
int num = 0;
    for (unsigned int i=0;  i <  TEXT.length(); i++)
    {
        if(TEXT.at(i) == TEXT.at(i));
        {
           num++;
        }
        cout << "character: "  << TEXT.at(i) << " Count " <<  num << endl;
    }
So, I guess you didn't write the functions in your previous post: http://www.cplusplus.com/forum/beginner/115894/

See if this helps: http://ideone.com/VgSOq3
Topic archived. No new replies allowed.