counting backwards instead
This commit is contained in:
parent
6c210c9b40
commit
1d4044d586
10
ex11.c
10
ex11.c
@ -2,10 +2,12 @@
|
|||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
int i = 0;
|
int i = argc;
|
||||||
while(i < argc) {
|
int arg;
|
||||||
printf("arg %d: %s\n", i, argv[i]);
|
while(i > 0) {
|
||||||
i++;
|
arg = argc - i;
|
||||||
|
printf("arg %d: %s\n", arg, argv[arg]);
|
||||||
|
i--;
|
||||||
}
|
}
|
||||||
|
|
||||||
char *states[] = {
|
char *states[] = {
|
||||||
|
Loading…
Reference in New Issue
Block a user