title: C++ Add byte value to CString as int
body: <p>Let's start off by stating that I have 0 xp with C++.</p>
  
  <p>I have a byte array which is filled with data.</p>
  
  <p>Example:</p>
  
  <pre><code>byte 0: 1
  byte 1: 75
  byte 2: 125
  byte 3: 66
  byte 4: 114
  byte 5: 97
  byte 6: 109
  </code></pre>
  
  <p>I have a CString in C++ which is supposed to get all the bytes. But bytes 0-2 are supposed to be int's and bytes 3-6 are supposed to be ASCII characters. </p>
  
  <p>When I read the bytes and place them in the CString the following will be shown:</p>
  
  <p><code>" K}Bram"</code></p>
  
  <p>Only the "Bram" part is correct. 
  The output should be:</p>
  
  <pre><code>"175125Bram"
  </code></pre>
  
  <p>I have a switch on the byte array's index so I can control the bytes.
  For bytes 0-2 I use the following code:</p>
  
  <pre><code>receiveStr += "" + (int)buffer[i]);
  </code></pre>
  
  <p>For the bytes 3-6 I use the following code:</p>
  
  <pre><code>if ((buffer[i] &gt;= 0x20 &amp;&amp; buffer[i] &lt;= 0x7E) || (buffer[i] == '\r') || (buffer[i] == '\n') || (buffer[i] == '\t'))
  {
      receiveStr += buffer[i];
  }
  else
  {
      // Display the invalid character placeholder (square)
      receiveStr += (char)0x7F;
  }
  </code></pre>
  
  <p>How can I 'convert' the first bytes to int's?</p>