title: what is the visibility/scope of a global variable in C?
body: <p>I'm having two .c files: A1.c and A2.c</p>
  
  <p>A1.c as follows:</p>
  
  <pre><code>int i=0;
  void main()
  {}
  </code></pre>
  
  <p>A2.c as follows:</p>
  
  <pre><code>int i=0;
  void func()
  {}
  </code></pre>
  
  <p>It compiles well but when I try to link these two .o files, there is a "multiple definition of i" error.
  I understand <code>i</code> is a global variable here, but doesn't it need an <code>extern</code> keyword to be used in other files. And in my project I'm not using the <code>extern</code>. So how come I get an error?</p>