its not working because you need to use a lot more counters. using only one counter what do you do when the characters in the string are in random order?
<< *dest = counter + '0';
That will not work when the value of counter is greater than 9 because 10 + '0' is 10 + 48 = 58, or the ascii value for a colon (see an ascii chart) But it will be ok if your assignment limits the number of allowed characters to less than 10.
>> source++;
move that line down just below the end of the if statement because source needs to be incremented at each iteration of the while loop.
>> counter=0;
move that line up under the else statemnet. Only want to zero it out then the letter changes.