I believe the easy way is to keep 2 char arrays
- First one contains the word
- Second one contains the first letter and the
_char otherwise
What you display to the player is the second array of course.
When you check if the user guessed correctly, find at which index it was in the 1st array, and replace _ by that letter in the second array at the same index.
In order to to do that, you should not use the Contains method in order to know if the letter is in the word, but rather parse the array yourself to find where the letter matches.
It could look like this
void CheckInputLetter(array1, array2, letter)
{
int i = 0;
while (array1[i] != '\0') //parse the whole array
{
if (array1[i] == letter)
array2[i] = letter;
i++;
}
}