title: Copy struct to buffer
body: <p>I have a structure:</p>
  
  <pre><code>struct data{
   int num1;
   int num2;
   int num3;
   int num4;
  }
  </code></pre>
  
  <p>Now, I can convert individual elements and then put them in a buffer, but I want to copy the whole structure into a buffer(char buffer[sizeof(data)]).</p>
  
  <p>Is there a way to copy ?</p>