Concatenating two char arrays in C
<p>I have two char arrays (char string1[7] and char string2[256]) which I need to print in a specific format. Both strings have a random number of entries terminated with a '\0' null byte.</p>

<ul>
<li>I need to print string1 </li>
<li>followed by a space on 9th character</li>
<li>followed by string2 - which MUST begin printing from the 10th character onwards.</li>
</ul>

<p>I have tried implementing this by copying the strings to a new array which I can print directly, however it is not working.</p>

<pre><code> while(string2[i]!='\0')
        {   


                if(i&lt;9 &amp;&amp; string1[i]!='\0')
                {
                    Printline[i]=string1[i];
                }
                else if (i&gt;9)
                {
                    Printline[i]=string2[i];
                }
                i++;

        }

        printf("%s\n",Printline);
</code></pre>

<p>Any help is much appreciated :)</p>