title: How to Store Binary Tree to File - C language
body: <p>I am maintaining a tree of Complex structures in C language. The structure is given below. Now I would like some library or source code that can allow me to SAVE and retrieve this binary tree of Complex structures from/to a File. Thanks a lot for help.  </p>
  
  <pre><code>typedef struct rb_red_blk_node {
      int isdataNode; /* if isdataNode=0 then the node is not the one carrying data */
      int red; /* if red=0 then the node is black */
      int Maxnodecount;
  
      // For hash nodes only.
      off_t heighestnodeleftsubtree;
      char* hash;
      int filecounter;
      //void* key;
  
      // For datanodes nodes only.
      off_t startkey; // Starting bytes of file.
      off_t endkey;   // Ending bytes of file.
      char *filename;
      void* info;
  
      struct rb_red_blk_node* left;
      struct rb_red_blk_node* right;
      struct rb_red_blk_node* parent;
  } rb_red_blk_node;
  </code></pre>