Last active
June 30, 2019 04:34
-
-
Save Loliver1224/e32c3eb03eea6abadedc0e7fe7cce77f to your computer and use it in GitHub Desktop.
実はC言語のmain関数には第3の引数が存在するというわけで
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 *envp[]){ | |
/* check argc */ | |
printf("argc = %d\n", argc); | |
/* check argv */ | |
printf("argv = ["); | |
for(int i=0; i<argc; i++) | |
printf("\'%s\' ", argv[i]); | |
puts("]"); | |
/* check envp */ | |
printf("envp = ["); | |
for (int i=0; envp[i] != NULL; i++) | |
printf("\'%s\' ", argv[i]); | |
puts("]"); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment