title: C: byte-copy unsigned char value
body: <pre><code>void callback(const unsigned char* data, int len) {
   unsigned char copydatahere;
  }
  </code></pre>
  
  <p>data is a pointer-to-const situation, that is allocated in library outside. len is a size of data, guessing it to be sizeof(unsigned char)*N.</p>
  
  <p>How I allocate <code>copydatahere</code> to size of <code>len</code> and copy the whole memory behind <code>data</code> including null bytes, string termination chars and anything other that has byte representation? What would be the difference between bcopy and memcpy in this situation?</p>
  
  <hr>
  
  <p>Addition:
  <code>memcpy(pointer+offset, sourcedata, size);</code>that's how you can do 'memcpy append' guys. Thank you all!</p>