You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
box-o-sand/ex10.c

24 lines
410 B

#include <stdio.h>
int main(int argc, char *argv[])
{
int i = 0;
char *arg;
for(i = 0; i < argc && (arg = argv[i]); i++) {
printf("arg %d: %s\n", i, arg);
}
char *states[] = {
"California", "Oregon",
"Washington", "Texas"
};
int num_states = 4;
for(i = 0; i < num_states; i++) {
printf("state %d: %s\n", i, states[i]);
}
return 0;
}