title: Creating and sending data packets in C/C++
body: <p>Let's say I want to send the following data to a socket using C or C++, all in one packet:</p>
  
  <pre><code>Headers
  -------
  Field 1: 2 byte hex
  Field 2: 2 byte hex
  Field 3: 4 byte hex
  
  Data
  ----
  Field1 : 2 byte hex
  Field1 : 8 byte hex
  </code></pre>
  
  <p>What would the code typically look like to create and send the packet containing all this data?</p>