Is there a better way of copying a string to a character array with things already in it
<pre><code>messageBuffer[0] = 1;
messageBuffer[1] = 0;
for (int i = 2; i &lt; (userName.size() + 2); i++)
{
    messageBuffer[i] = userName[(i - 2)];
}
</code></pre>

<p>userName is a string. I was just wondering if there is already a function that exists that I haven't found yet. I have tried looking on cpluscplus but nothing that I see.
Thanks for all the help guys =) I really appreiciate it. This site is awesome!</p>
