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

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.

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

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.