Created
September 28, 2016 23:32
-
-
Save Bueddl/9e750f82efb5f9ea708a4a7d74707c68 to your computer and use it in GitHub Desktop.
This file contains 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 const *argv[], char const *envp[]) | |
{ | |
int i; | |
char **env; | |
FILE *fp; | |
fp = argc == 2 ? fopen(argv[1], "w") : stdout; | |
for (i = 0; i < argc; ++i) | |
fprintf(fp, "argc[%d] = '%s'\n", i, argv[i]); | |
for (env = envp; *env; ++env) | |
fprintf(fp, "%s\n", *env); | |
// none closing | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment