title: How to append a char* to the end of a void*?
body: <p>Assume we have defined a char* as follow:</p>
  
  <pre><code>char *x;
  </code></pre>
  
  <p>And we have a function like it:</p>
  
  <pre><code>void append(void *y, char *z);
  </code></pre>
  
  <p>This function appends it's second parameter (where the pointer <strong>z</strong> is pointing at) to the end of a string that the pointer <strong>y</strong> is pointing to it's beginning. The reason that I am restricted to have the first parameter to be <strong>void*</strong> is that I need to override a <a href="https://curl.haxx.se/libcurl/c/CURLOPT_HEADERFUNCTION.html" rel="nofollow noreferrer">libcurl</a> function:</p>
  
  <pre><code>size_t header_callback(char *buffer, size_t size, size_t nitems, void *userdata);
  </code></pre>
  
  <p>Any time the header_callback function is called I need to append buffer to the end of userdata. The userdata pointer is pointing to beginning of a string.</p>