Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Edited by sciSpider v2.1 (sch jbop) (X_X)@==(Q_Q)@

...

Wiki Markup
According to C99 \[[ISO/IEC 9899-:1999|AA. C References#ISO/IEC 9899-1999]\]:

Wiki Markup
In a hosted environment, the main function receives a third argument, {{char \*envp\[\]}}, that points to a NULLnull-terminated array of pointers to {{char}}, each of which points to a string that provides information about the environment for this execution of the program.

...

Unanticipated results may occur if setenv() changes the external variable environ.  In particular, if the optional envp argument to main() is present, it is not changed, and thus as a result may point to an obsolete copy of the environment (as may any other copy of environ).

...

The getenv function searches the list of environment variables for varname. getenv is not case sensitive in the Windows operating system. getenv and _putenv use the copy of the environment pointed to by the global variable _environ to access the environment. getenv operates only on the data structures accessible to the run-time runtime library and not on the environment "segment" created for the process by the operating system. ThereforeConsequently, programs that use the envp argument to main or wmain may retrieve invalid information.

...

Wiki Markup
\[[ISO/IEC 9899-:1999|AA. C References#ISO/IEC 9899-1999]\] Section J.5.1, "Environment Arguments"
\[[Open Group 04|AA. C References#Open Group 04]\] [{{setenv()}}|http://www.opengroup.org/onlinepubs/009695399/functions/setenv.html]

...