Oh dear.
A suggestion for you: Set up two arrays: one with 26 characters in, filled from a string "abcdefgh...". The other with 26 integers, all preset to zero.
For each character in the input string, loop through the characters string and see if it is in there. Increment the corresponding integer in the array if it is.
Then when you print them, loop through again, printing the character and the count:
for (int iCount = 0; iCount < acCharsLengthl iCount++)
{
cout<<acChars[iCount]<<" appeared "<<aiCounts[iCount]<<" times."<<endl;
}
Your code will be smaller, quicker, and easier to maintain. Then try to work out what your other problem is!