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
- name
- C string containing the name of the requested variable.
Return Value
A null-terminated string with the value of the requested environment variable, or NULL if that environment variable does not exist.Portability
Depending on the platform, this function may either be or not be case sensitive.Example
| 1 2 3 4 5 6 7 8 9 10 11 12 |
|
The example above prints the PATH environment variable.
See also
| system | Execute system command (function) |
