title: Dynamically allocate C struct?
body: <p>I want to dynamically allocate a C struct:</p>
  
  <pre><code>typedef struct {
      short *offset;
      char *values;
  } swc;
  </code></pre>
  
  <p>Both 'offset' and 'values' are supposed to be arrays, but their size is unknown until runtime.</p>
  
  <p>How can I dynamically allocate memory for my struct and the struct's arrays?</p>