title: structure with linked-list memory dump
body: <p>is there any standard approach which I've missed at school to dump C <strong>structure with nested linked lists</strong> on disk in reasonable way?
  What I don't want to do is:</p>
  
  <ul>
  <li>use protocol-buffers or any other like serializators,</li>
  <li>don't want to create JSON, XML or other</li>
  </ul>
  
  <p>I've few ideas:</p>
  
  <ul>
  <li>allocate accurate memory amount (or extend existing one) and manage it by myself, placing list elements in stack like approach using some additional fields to manage relative addresses. When necessary dump block on disk. Having procedures to map block from disk create desirable structure being aware of Byte-order.</li>
  <li>push main structure to file, then push List elements, store information about list in the header of a file.</li>
  </ul>
  
  <p>To image this I'll give some more details posting example code:</p>
  
  <pre><code>typedef struct{
     int b;
     List *next;
  }List;
  
  typedef struct{
     float b;
     List2 *next;
  }List2;
  
  typedef struct{
     List *head;
     List *tail;
  } info;
  
  typedef struct{
     List2 *head;
     List2 *tail;
  } info2;
  
  struct data
  {
      int a;
      char t[10];
      info first;
      info second;
      info2 third;
  };
  </code></pre>
  
  <p>cheers
  P.</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>I've extended main structure, seems like previous one haven't indicate the problem fully.
  I'm aware that pointers on disk are useless.
  Ideas and pseudocode allowed.</p>