...
Code Block |
---|
main(int argc, char **argv, char **envp) {}
|
Wiki Markup |
---|
According to C99 \[[ISO/IEC 9899-1999:TC2|AA. C References#ISO/IEC 9899-1999TC2]\]: |
...
Code Block | ||
---|---|---|
| ||
int main(int argc, char **argv, char **envp) { setenv("MY_NEW_VAR", "/usr/binnew_value", 1); if (envp != NULL) { for (i = 0; envp[i] != NULL; i++) { printf("%s\n", envp[i]); } } return 0; } |
...
Code Block | ||
---|---|---|
| ||
extern char **environ; int main(int argc, char **argv) { setenv("MY_NEW_VAR", "/usr/binnew_value", 1); if (environ != NULL) { for (i = 0; environ[i] != NULL; i++) { printf("%s\n", environ[i]); } } return 0; } |
...