##### cppreference.com

##### Search

Create account

##### Namespaces

- Page
- Discussion

##### Variants

##### Views

- View
- Edit
- History

##### Actions

# getenv

From cppreference.com
< c‎ | program

Defined in header `<stdlib.h>` |  |
const char *getenv( const char *env_var ); |  |

Searches for an environmental variable with name `env_var` in the host-specified environment list and returns information associated with it. The set of environmental variables and methods of altering it are implementation-defined.

### [edit] Parameters

env_var | - | null-terminated character string identifying the name of the environmental variable to look for

### [edit] Return value

character string identifying the value of the environmental variable or NULL if such variable is not found.

### [edit] Example

| This section is incomplete Reason: no example

### [edit] See also

C++ documentation for getenv

Retrieved from "http://en.cppreference.com/mwiki/index.php?title=c/program/getenv&oldid=49071"
Category:

- Todo no example