putenv()

Prototype: int putenv(const char *asetting);
Header File: stdlib.h (C) or cstdlib (C++)
Explanation: Use putenv to modify the environmental settings for the program. It should be used in the form: TYPE_OF_SETTING (such as PATH, DEVICE, etc.)=WHAT_TO_SET_TO.



//Example sets the defined paths for the program to C:\
//Example then lists the paths
#include <iostream>
#include <cstdlib>
int main()
{
    putenv("PATH=C:\");
    cout<<getenv("PATH");  
}
Other Functions