|
getenvfunction
<cstdlib> char * getenv ( const char * name ); Get environment string Retrieves a C string containing the value of the environment variable whose name is specified as argument. If the requested variable is not part of the environment list, the function returns a NULL pointer.The string pointed by the pointer returned by this function shall not be modified by the program. The same memory location may be used in subsequent calls to getenv, overwriting the previous content. Parameters
Return ValueA null-terminated string with the value of the requested environment variable, or NULL if that environment variable does not exist.PortabilityDepending on the platform, this function may either be or not be case sensitive.Example
The example above prints the PATH environment variable. See also
|