git-subtree-dir: lcthw-remnants git-subtree-mainline: 4107485591a9ea2121b65d60d8a08c298451a74b git-subtree-split: e172f73c8297b22a579c94558f0c171ca74a0e5c
26 lines
495 B
C
26 lines
495 B
C
#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 = 0; 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"
|
|
};
|
|
int num_states = 4;
|
|
|
|
for(i = 0; i < num_states; i++) {
|
|
printf("state %d: %s\n", i, states[i]);
|
|
}
|
|
|
|
return 0;
|
|
}
|