how?

i am creating hangman and i have two strings
guess and word
if in word find my guess(using find())
if found it it is replaced(using the replace())
but if there are two same letters it can't find the second

for example if the word is:pap
it will go until pa_
and when i put <p> nothing happen/
so how can make it so to find and the second or third same letter?
find again, starting at the place the last one was found, and keep using find again and again until it doesn't find any more.
^^ Starting at the place the last one was found plus 1.
i didnt understand,can show me?
You were in such a hurry while asking the question.. come on now, explain your problem, show us what you have done so far..
otherwise you wont get much help.
Check out the example in find_first_of()
http://www.cplusplus.com/reference/string/string/find_first_of/
i am creating a hangman
and when i must find a word like this:pop
my program will find po_
so the second p will not find,so what should dO?
TO put fnd first of for the first character and find after?
Topic archived. No new replies allowed.