Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Watcom C/C++ v10.0 : C library - <b>synopsis:</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Synopsis:
    #include <stdlib.h>
    char *getenv( const char *name );

Description:
    The getenv function searches the environment list for an entry matching
    the string pointed to by name.  The matching is case-insensitive; all
    lowercase letters are treated as if they were in upper case.

    Entries can be added to the environment list with the DOS set command or
    with the  putenv or  setenv functions.  All entries in the environment
    list can be displayed by using the DOS set command with no arguments.

    To assign a string to a variable and place it in the environment list:


             C>SET INCLUDE=C:\WATCOM\H

    To see what variables are in the environment list, and their current
    assignments:


             C>SET
             COMSPEC=C:\COMMAND.COM
             PATH=C:\;C:\WATCOM
             INCLUDE=C:\WATCOM\H


Returns:
    The getenv function returns a pointer to the string assigned to the
    environment variable if found, and NULL if no match was found.  Note:
     the value returned should be duplicated if you intend to modify the
    contents of the string.

See Also:
    clearenv, exec Functions Functions, putenv, _searchenv, setenv, spawn Functions Functions,
    system

Example:
    #include <stdio.h>
    #include <stdlib.h>

    void main()
      {
        char *path;

        path = getenv( "INCLUDE" );
        if( path != NULL )
          printf( "INCLUDE=%s\n", path );
      }

Classification:
    ANSI

Systems:
    All

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson