2009-10-29 06:29:13 +03:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <string.h>
|
2016-05-16 17:34:04 +03:00
|
|
|
int main(int ac, char* av[])
|
2009-10-29 06:29:13 +03:00
|
|
|
{
|
|
|
|
int i;
|
|
|
|
printf("ac = [%d]\n", ac);
|
2016-05-16 17:34:04 +03:00
|
|
|
for (i = 0; i < ac; i++) {
|
2009-10-29 06:29:13 +03:00
|
|
|
printf("arg[%d] = %s\n", i, av[i]);
|
2016-05-16 17:34:04 +03:00
|
|
|
}
|
|
|
|
if (ac == 3) {
|
|
|
|
if (strcmp(av[1], "arg1") == 0 && strcmp(av[2], "arg2") == 0) {
|
2009-10-29 06:29:13 +03:00
|
|
|
printf("arg1 and arg2 present and accounted for!\n");
|
|
|
|
return 0;
|
|
|
|
}
|
2016-05-16 17:34:04 +03:00
|
|
|
}
|
2009-10-29 06:29:13 +03:00
|
|
|
printf("arg1 and arg2 missing!\n");
|
|
|
|
return -1;
|
|
|
|
}
|