0

Do I have to do that for ever letter in the alphabet?
apha+=1
apha+=1

0

No...I think you dont get the logic.

while( ! ischar( str[i] ) ) { ++i ; }
// increment the counter here since "i" points to an alphabet
counter[str[i]] ++ ;

Do the same for the other loop.

0

Can you tell me how I can display the value of the counter using the code I showed earlier?

0

I wont write teh code but give you a general algo:

1. Move through the array counter.
2. If at an index i you encounter a value > 0 display the equivalent character of i.
3. After the above condition is satisfied, start a for loop which will print out the number of stars which equals the vaule of the counter for that particular i in front of the character.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.