title: Printing Environmental variables in Linux
body: <p>I am new to Linux. I came across this piece of code to print environmental variables. It is kind of confusing me. How can this code print the environmental variables?</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  extern char **environ;
  int main()
  {
      char **var;
      for(var=environ; *var!=NULL;++var)
          printf("%s\n",*var);
  
      return 0;
  }
  </code></pre>
  
  <p>what is <code>extern</code> here?</p>