you can do<p>x = malloc(sizeof <i>x + &lt;variable_length))<p>x-&gt;zero_array points to the variable_length.<p>The advantage is that you get contiguous memory access and do a single malloc.<p>As opposed to:<p>x = malloc(sizeof </i>x)<p>x-&gt;ptr = malloc(&lt;variable_length&gt;);<p>x and ptr are not necessarily contiguous.