title: Error 1 error C2099: initializer is not a constant
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/4462868/c-compiler-error-initializer-not-constant">C compiler error - initializer not constant</a><br>
    <a href="https://stackoverflow.com/questions/13785250/definition-of-global-variables-using-a-non-constant-initializer">Definition of global variables using a non constant initializer</a>  </p>
  </blockquote>
  
  
  
  <p>I have 2 variables defined globally given below and I get the C2099 error. I am using Visual Studio 2005.</p>
  
  <p>Here are the variables:</p>
  
  <pre><code>const char* key = "AZFFProgramFiles";
  const char* val = getenv(key);
  </code></pre>