Created
January 15, 2018 01:52
-
-
Save reporter123/30caef1ad4019efedcb591ea5669739d to your computer and use it in GitHub Desktop.
Hidden third parameter to main
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
int main(int argc, char** argv, char** env) | |
{ | |
int i = 0; | |
while(env[i] != 0) | |
{ | |
printf("%s\n", env[i++]); | |
} | |
return(0); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
libc pass the environment as a third parameter to main on Linux and possibly other systems.