 <p>Are you using <code>sizeof(*h)</code> to determine the number of <code>List</code> elements in an array?</p> <p><code>sizeof(*h)</code> returns the size of <code>List</code>. Since <code>tostring()</code> only get's a pointer to a <code>List</code>, it has no way of knowing how many elements are pointed to.</p> <p>In any case, it appears you are then writing a string to a character array of this size. What does the size of <code>List</code> have to do with the number of elements in the array? What are you trying to do?</p>