title: What's the use of the third, environment variable argument to the C++ main()?
body: <p>I have come to understand that <code>char **envp</code> is the third argument to <code>main</code>, and with the help of the code below, I was able to see what it actually contains.</p>
  
  <pre><code>int main(int argc, char *argv[], char *env[])
  {
    int i;
    for (i=0 ; env[i] ; i++)
      std::cout &lt;&lt; env[i] &lt;&lt; std::endl;
    std::cout &lt;&lt; std::endl;
  }
  </code></pre>
  
  <p>My question is: why (in what situations) would programmers need to use this? I have found many explanations for <em>what</em> this argument does, but nothing that would tell me <em>where</em> this is typically used. Trying to understand what kind of real world situations this might be used in. </p>