Representing integers as a byte
<p>Currently I'm working on an assignment and using C++ for the first time.
I'm trying to append certain "message types" to the beginning of strings so when sent to the server/client it will deal with the strings depending on the message type. I was wondering if I would be able to put any two-digit integer into an element of the message buffer.... see below.</p>

<p>I've left a section of the code below:</p>

<pre><code>char messageBuffer[32];
messageBuffer[0] = '10';       &lt;&lt; I get an overflow here

messageBuffer[1] = '0';    
for (int i = 2; i &lt; (userName.size() + 2); i++)
{
    messageBuffer[i] = userName[(i - 2)];
}
</code></pre>

<p>Thanks =)</p>
