title: Initializing constant struct containing pointer to its own type
body: <p>I'm having a struct like this:</p>
  
  <pre><code>typedef struct tree_s{
      struct tree_s *a;
      int b;
  }tree_t;
  </code></pre>
  
  <p>Which, at the moment, I am initializing in this way:</p>
  
  <pre><code>tree_t branch_n = {
      .a = NULL,
      .b = 2
  };
  
  tree_t root = {
      .a = (tree_t*) &amp;branch_n, 
      .b = 1
  };
  </code></pre>
  
  <p>Now, it annoys me that I have to initialize the lower branches before the root because the complete structure is quite large, with the branches having branches on their own, making my code hard to manage.</p>
  
  <p>What I would like to do is something like this:</p>
  
  <pre><code>tree_t root = {
      .a = 
       //The first branch
       {                 
          .a =
           //Yet another branch 
           { //Since the following is actually an array, I need the 
             // "a" above to point to the first index
               {  
                   .a = NULL,         //Maybe this will have its own branch
                   .b = 3
               },
               {
                   .a = 
                   {
                       .a = NULL,     //And this might even have its own branch
                       .b = 5
                   }
                   .b = 4  
               }
           }
          .b = 2
       }, 
      .b = 1
  };
  </code></pre>
  
  <p>How can I achieve an initialization like this?</p>
  
  <p>The main reason I want to do this is to greatly enhance the overview of my code and immediately visually see the structure of the "Tree".</p>
  
  <p>Note that the structure of the complete "Tree" is know from the start which is why I consider the structure constant. The value b however may be changed at any time.</p>
  
  <p>I am quite new to the C language and this is my first post on SO, so feel free to edit or ask if I havent been able to make myself clear :)</p>