Replacing an char array with another
<p>First time actually posting on here, quite excited hehe..</p>

<p>So we got this task from school to make a hangman game. I've done most of the difficult things, but there is one thing I can't seem to solve and google couldn't find the answer for me either, so here I am. </p>

<pre><code>`int guess()
{
    char letter[0];
    int tries=0;
    for(int i=0;i&lt;length;i++)
    {
        meme[i]='_';
    }
    cout&lt;&lt;meme;
    cout&lt;&lt;"Guess a letter: ";
    cin&gt;&gt;letter;
    while(strlen(letter) &gt;= 2)
    {
        cout&lt;&lt;"Guess a letter: ";
        cin&gt;&gt;letter;
    }
    for(int i=0;i&lt;length;i++)
    {
        if(letter[0]==word[i])
        {
            meme[i]=letter[0];
        }
        else
        {
            //Fel bokstav
        }
        cout&lt;&lt;meme;
    }
}`
</code></pre>

<p>"Meme" is the blank spaces, and what happens is that when I enter a correct letter, instead of replacing the '_'s in the char "Meme", I get something in the line of this (let's say the word is meme): </p>

<p>"Guess a letter: m"</p>

<p>"m___m___m_m_m_m_"</p>

<p>If anyone could help me out with this problem I'd be truly greatful. Thanks in advance!</p>