This function asks the host operating system to return the value of the string that is pointed to by name. If name is known to the host operating system, the function returns a pointer to the corresponding global string value; otherwise, a null pointer is returned.
Note that the string value pointed to by getenv is valid only until the next call on getenv.
Subsequent calls on getenv overwrite the memory used for the original result. If you need to make several calls to getenv, you should therefore copy the value returned by getenv into a local string before making further calls.
Under MS-DOS, name is assumed to be a pointer to a string which is the name of an environment variable, such as PATH, or any of those defined by the SET command.
Note that the names of all environment variables are forced to be upper-case by the command processor. Thus, the result of the following command would be the definition of a variable called FRED set to the value Mixed:
» set fred=Mixed
|