diff options
| author | mo khan <mo@mokhan.ca> | 2014-07-30 21:31:36 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2014-07-30 21:31:36 -0600 |
| commit | 17d0ad5d63e5338b04d8a92248e6e6b647095274 (patch) | |
| tree | 90a1dc9b8835f9d767b11fb281b1ebf1618ce6b7 | |
| parent | fd8f583a5df52d947d0339f7b89305665923dbbc (diff) | |
add example of reading environment variables.
| -rw-r--r-- | getenv_example.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/getenv_example.c b/getenv_example.c new file mode 100644 index 0000000..5a8dfa3 --- /dev/null +++ b/getenv_example.c @@ -0,0 +1,8 @@ +#include <stdio.h> +#include <stdlib.h> + +int main(int argc, const char *argv[]) +{ + printf("%s is at %p\n", argv[1], getenv(argv[1])); + return 0; +} |
