title: How to properly use memcpy?
body: <p>I have a <code>mainbuf[bufsize]</code>, empty initially.</p>
  
  <p>I am reading from some input : <code>read(fd, otherbuf, sizeof(otherbuf))</code> different strings which are assigned to <code>otherbuf</code>. Every time I assign a new string to <code>otherbuf</code> I want to append it to <code>mainbuf</code>.</p>
  
  <p>I do:</p>
  
  <p><code>memcpy(mainbuf,otherbuf, numberofBytesReadInotherbuff)</code> but it does not give me all the strings. Usually the last <code>otherbuf</code> is right, but all the other ones are missing characters.</p>