title: How to list all environment variables in a c/c++ app
body: <p>I know that when programming in c++ I can access individual environment variables with <a href="http://www.cplusplus.com/reference/cstdlib/getenv/" rel="noreferrer"><code>getenv</code></a>.</p>
  
  <p>I also know that, in the os x terminal, I can list ALL of the current environment variables using <a href="http://en.wikipedia.org/wiki/Env" rel="noreferrer"><code>env</code></a>.</p>
  
  <p>I'm interested in getting a complete list of the environment variables that are available to my running c++ program. Is there a c/c++ function that will list them? In other words, is there a way to call <code>env</code> from my c++ code?</p>