//* Access environment variables in ANSI C/C99 *

#ifdef _MSC_VER // for MS Visual Studio compilers - to allow "classic" insecure printf and scanf #define _CRT_SECURE_NO_WARNINGS #endif #include <stdio.h> #include <stdlib.h> int main () { char *path; path = getenv("PATH"); fprintf ( stdout, "Your path is %s.\n", path ); return(0); }