int putenv ( const char * envvar );
Create or modify environment variable.
Adds the specified string variable to the environment of the current process. Because environment accepts only one variable per name, this function can also be used to modify or delete existing environment variables.
putenv can only modify the environment variables for this process and any process created from this, not the operating system level. Once this process ends the environment variables of the parent process will not be changed by this call.
0 if successful.
-1 in case of error.
Not defined in ANSI-C. Supported by many compilers.
/* putenv example */
char * buffer ;
buffer = getenv ("RESOURCES");
puts ("environment variable successfully set");
else puts ("environment variable already existed");