What's the difference between environ and envp? They both seem to do the same thing...
environ
Code:#include <stdio.h> #include <unistd.h> extern char **environ; int main(int argc, char *argv[]) { char **p = environ; while (*p != NULL) { printf("%s (%p)\n", *p, *p); *p++; } return 0; }
envp
Code:#include <stdio.h> int main(int argc, char *argv[], char *envp[]) { char **p = envp; while (*p != NULL) { printf("%s (%p)\n", *p, *p); *p++; } return 0; }