Getting error `\365\277\357\376 in the terminal : <p>The task is to output every second word from the string</p>

<p>I made a loop to check every character in the string and while it reaches a space the boolean will change it value to the opposite so before it reaches the next space it will copy the characters from first string to the second</p>

<pre><code>int main(void)
{
char str1[max]="Hellow my name is Tom why not today";
  char str2[max];
    int i;
    bool a=false;
    for (i=0;i&lt;strlen(str1);i++)
    {
        if ((int)str1[i]==32)
        {
            a=!a;
        }
        if (a==true)
        {
            str2[i]=str1[i];
        }
    }
    printf ("%s\n",str2);
    return 0;

}
</code></pre>

<p>The terminal shows: `\365\277\357\376 my\365\277\357\376 isu</p>
