title: C++: Setenv(). Undefined identifier in Visual Studio
body: <p>Look my code seems to be correct, according to all the documentation I can find online. My IDE is MS Visual Studio Xpress 4 Windows Desktop 2012, and it's compiler is throwing up the error: </p>
  
  <p><code>Error  1   error C3861: 'setenv': identifier not found e:\users\owner\documents\visual studio 2012\projects\project1\project1\source1.cpp  18  1   Project1</code>.</p>
  
  <p>Help me!!!</p>
  
  <pre><code>#include &lt;windows.h&gt;
  #include &lt;sstream&gt;
  #include &lt;ostream&gt;
  #include &lt;cstdlib&gt;
  #include &lt;iostream&gt;
  #include &lt;stdlib.h&gt;
  
  using namespace std;
  
  int howManyInClass = 0;
  int main(){
  
  long checklength = sizeof(getenv("classSize"))/sizeof(*getenv("classSize"));
  if (checklength==0){
      cout&lt;&lt;"Please enter the ammount of students in your class";
      cin&gt;&gt; howManyInClass;
      cin.ignore();
      setenv("classSize", howManyInClass, 1);}
  
  };
  </code></pre>