title: How to initialize a struct to null?
body: <p>I have a struct that contains two other structs of the same type, and I want to initialize it to have both NULL to start.  How do I do that?  I've tried the below, but get compiler warnings with gcc.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  typedef struct Segment {
      int microseconds;
  } Segment;
  
  typedef struct Pair {
      Segment mark;
      Segment space;
  } Pair;
  
  int main()
  {
      Pair mark_and_space = { .mark = NULL, .space = NULL };
  
      return 0;
  }
  </code></pre>
  
  <p>And the compiler warnings: </p>
  
  <pre><code>main.c:14:5: warning: initialization makes integer from pointer without a cast [enabled by default]                                                   
   Pair mark_and_space = { NULL,  NULL };                                                                                                           
   ^                                                                                                                                                
  main.c:14:5: warning: (near initialization for 'mark_and_space.mark.microseconds') [enabled by default]                                               
  
  main.c:14:5: warning: initialization makes integer from pointer without a cast [enabled by default]                                                   
  main.c:14:5: warning: (near initialization for 'mark_and_space.space.microseconds') [enabled by default] 
  </code></pre>