init commit
This commit is contained in:
23
learncthehardway/ex10/ex10.c
Normal file
23
learncthehardway/ex10/ex10.c
Normal file
@ -0,0 +1,23 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
int i = 0;
|
||||
|
||||
// go through each string in argv
|
||||
for (i = 1; i < argc; i++) {
|
||||
printf("arg %d: %s\n", i, argv[i]);
|
||||
}
|
||||
|
||||
// Make an array of strings
|
||||
char *states[] = {
|
||||
"California", "Oregon",
|
||||
"Washington", "Texas"
|
||||
};
|
||||
int num_states = 4;
|
||||
|
||||
for (i = 0; i < num_states; i++) {
|
||||
printf("states %d: %s\n", i, states[i]);
|
||||
}
|
||||
return 0;
|
||||
}
|
Reference in New Issue
Block a user