Skip to content

Commit

Permalink
Added program to test command line and environment variable passing.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Oct 6, 2016
1 parent 262b428 commit fa77133
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/testargv.c
@@ -0,0 +1,20 @@
#include <stdio.h>

int main(int argc, char **argv, char **envp) {
int i;

printf("Command line: (argc == %d)\n", argc);
for (i = 0; i <= argc; i++) {
printf("argv[%d] = '%s'\n", i, argv[i]);
} // for

printf("\nEnvironment:\n");
for (i = 0; envp[i]; i++) {
printf("envp[%d] = '%s'\n", i, envp[i]);
} // for

return 0;
} // main

// end of testargv.c ...

Binary file added tests/testargv.exe
Binary file not shown.

0 comments on commit fa77133

Please sign in to comment.