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.

27 lines
431 B

#include <stdio.h>
int main(int argc, char *argv[])
{
int i = 0;
// go through each string in argv
// why am I skipping argv[0]?
for (i = 1; i < argc; i++) {
printf("arg %d: %s\n", i, argv[i]);
}
// let's make our own array of strings
char *states[] = {
"California",
"Oregon",
"Washington",
"Texas",
NULL,
};
for (i = 0; states[i] != NULL; i++) {
printf("state %d: %s\n", i, states[i]);
}
return 0;
}