Declaring an extern variable in a header file <p>I have declared an extern <strong>global</strong> variable inside my main.<strong>h</strong> header file like this:</p> <pre><code>extern int variable; </code></pre> <p>Then, I defined the same global variable inside my main.<strong>c</strong> file like this:</p> <pre><code>int variable = 16; </code></pre> <p>The thing is that I am using another file called <strong>test.c</strong>, and I have included main.<strong>h</strong> header included inside. But I cannot gain access the the "<strong>16</strong>" value that I defined the extern with inside main.<strong>c</strong>. When I call "variable" inside <strong>test.c</strong>, the value of "variable" is "<strong>0</strong>". Should not any .c file that includes my main.<strong>h</strong> header have access to the "<strong>16</strong>" value since I have already defined my "variable" inside main.<strong>c</strong>???</p> <p>Thanks</p>