Programming

(C++) Environment Variable

steloflute 2012. 6. 15. 14:57
http://www.informit.com/guides/content.aspx?g=cplusplus&seqNum=136

 

#include <cstdlib>
#include <iostream>
using namespace std;
int main()
{
 char * descr = getenv("PATH");
 if (descr)
  cout<<"value of PATH is: "<< descr<<endl;
 else
  cout<<"variable not defined"<<endl;
}