letter counter

in a string how do you put counters on specific letter for example i input VXXI
it counts v as 1, x as 2 and I as 1 .

Newer post with responses is here:
http://www.cplusplus.com/forum/beginner/158090/#msg809414

In the future, please do not post more than once.
Topic archived. No new replies allowed.