title: C++ How to send structures over socket?
body: <p>Say I have a structure:</p>
  
  <pre><code>struct person
  {
      char name[10];
      int age;
  };
  
  struct car
  {
      int locationX;
      int locationY;
  };
  
  struct company
  {
      vector&lt;person&gt; employees;
      vector&lt;car&gt; cars;
  };
  </code></pre>
  
  <p>For example, I want to <code>send/recv</code> the whole <code>company</code> using socket (UDP).  So, send and recv once.</p>
  
  <p>How can I do that?  Could you please give me some code sinppet?  How to send everything and read everything.</p>
  
  <p>Thanks!</p>