title: The usage of extern in c++
body: <p>I've having difficulty understanding how 'extern' works.
  I've searched Google but there doesn't seem to be the particular example case I'm trying</p>
  
  <p>If i have a file main.cpp which references one.h
  and in it i have a list named LIST1 (which is a double array of 100 x 100)
  so I have double List1[100][100];</p>
  
  <p>how can i use this list in one.cpp please?</p>
  
  <pre><code>extern double LIST1[100][100]
  </code></pre>
  
  <p>is not working :/</p>
  
  <p>main.cpp:</p>
  
  <pre><code>#include "one.h"
  
  extern double LIST1[100][100];
  </code></pre>
  
  <p>one.cpp:</p>
  
  <pre><code>void one::useList()
  {
  for(j = 0; j &lt; 100; j++)
     {
       for(i = 0; i &lt; 100; i++)
      {
           LIST1[j,i] = 0.5;
      }
   }
  }
  </code></pre>
  
  <p>This is what I have.</p>
  
  <p>Error I'm getting:</p>
  
  <blockquote>
    <p>1>main.obj : error LNK2001: unresolved external symbol "double (*
    LIST1)[100]" (?LIST1@@3PAY0GE@NA)</p>
  </blockquote>