diff options
Diffstat (limited to 'test cases/common/41 test args/cmd_args.c')
-rw-r--r-- | test cases/common/41 test args/cmd_args.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test cases/common/41 test args/cmd_args.c b/test cases/common/41 test args/cmd_args.c new file mode 100644 index 0000000..545b795 --- /dev/null +++ b/test cases/common/41 test args/cmd_args.c @@ -0,0 +1,18 @@ +#include<stdio.h> +#include<string.h> + +int main(int argc, char **argv) { + if(argc != 3) { + fprintf(stderr, "Incorrect number of arguments.\n"); + return 1; + } + if(strcmp(argv[1], "first") != 0) { + fprintf(stderr, "First argument is wrong.\n"); + return 1; + } + if(strcmp(argv[2], "second") != 0) { + fprintf(stderr, "Second argument is wrong.\n"); + return 1; + } + return 0; +} |