title: How to declare a structure in a header that is to be used by multiple files in c?
body: <p>If I have a source.c file with a struct:</p>
  
  <pre><code>struct a { 
      int i;
      struct b {
          int j;
      }
  };
  </code></pre>
  
  <p>How can this struct be used in another file (i.e. <code>func.c</code>)?</p>
  
  <p>Should I create a new header file, declare the struct there and include that header in <code>func.c</code>?</p>
  
  <p>Or should I define the whole struct in a header file and include that in both <code>source.c</code> and <code>func.c</code>?  How can the struct be declared <code>extern</code> in both files?</p>
  
  <p>Should I <code>typedef</code> it? If so, how?</p>