<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>

a.h:
```
```
#ifndef A_H
#define A_H

struct a { 
    int i;
    struct b {
        int j;
    }
};

#endif
```
```
there you go, now you just need to include a.h to the files where you want to use this structure.