char * getenv ( const char * varname );
Get string from environment.
Gets a pointer to the null-terminated string containing the value of the environment variable which name is specified in varname. If the requested variable is not defined in the environment the function returns a NULL pointer.
The returned pointer is not intended for modifying operations on the environment variable. Refer to putenv or your platform's manual for that.
A null-terminated string with the value of the requested environment variable or NULL if that environment variable does not exist.
Do not use this returned pointer to modify directly the environment variable from your program.
Defined in ANSI-C. Depending on system this function may or not be case sensitive.
/* getenv example: getting path */
char * buffer;
buffer = getenv ("PATH");
printf ("Current path is: %s",buffer);
The example above shows the PATH environment variable on screen.