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 (unsignedint i=0; i < TEXT.length(); i++)
{
if(TEXT.at(i) == TEXT.at(i));
{
num++;
}
cout << "character: " << TEXT.at(i) << " Count " << num << endl;
}