Hi I am trying to write a hangman game. This is where I am stuck. Will just paste part of the code that is relevant:

Code:
for(int i = 0; word[i]!=0; i++) {                          
             
            if(word[i] != character) word[i] = '-';
This code does what I want it to do - to an extent. So if I type in the word hangman, and the guess word is h, I will get h----- Which is fine. Now my problem is this. Next time, if someone types in n, I want the code to print out h-n---n and not just --n---n And this is where I am stuck. When I am dealing with one single character, it is fine. But when dealing with more than one character, I don't know how to do it. And I am not supposed to use the string class.