title: extern storage class variable inside main function
body: <p>I get very confused with the static and extern storage classes. I do not understand what is wrong with the below code snippet. I expect the printf to print the value Zero. The build is failing with the error "Undefined reference to 'i' ". I expect the statement "extern int i" to be a valid <strong>C</strong> statement. Is it not?</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  void main()
  {
   extern int i;
   printf("%d", i);
   }
  </code></pre>