The {{getenv()}} function searches an environment list, provided by the host environment, for a string that matches a specified name. The {{getenv()}} function returns a pointer to a string associated with the matched list member. It is best not to store this pointer as it may be overwritten by a subsequent call to the {{getenv()}} function \[[ISO/IEC 9899-:1999|AA. C References#ISO/IEC 9899-1999]\] or invalidated as a result of changes made to the environment list through calls to {{putenv()}}, {{setenv()}}, or other means. Storing the pointer for later use could result in a dangling pointer or a pointer to incorrect data. |