Skip to content

Instantly share code, notes, and snippets.

@sugamasao
Created July 22, 2015 07:49
Show Gist options
  • Select an option

  • Save sugamasao/231a4a95763b9d6c3f06 to your computer and use it in GitHub Desktop.

Select an option

Save sugamasao/231a4a95763b9d6c3f06 to your computer and use it in GitHub Desktop.
C言語の4番目の引数が気になったメモ
#include<stdio.h>
int main(int argc, const char * argv[], char *envp[], char *apple[]){
int i = 0;
for (i = 0; i < argc; i++) {
printf("argv[%02d]: [%s]\n", i, argv[i]);
}
for (i = 0; envp[i] != NULL; i++) {
printf("envp[%02d]: [%s]\n", i, envp[i]);
}
for (i = 0; apple[i] != NULL; i++) {
printf("apple[%02d]: [%s]\n", i, apple[i]);
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment