using num_states again
This commit is contained in:
parent
5b7748c99a
commit
2830ca4774
9
ex10.c
9
ex10.c
@ -10,13 +10,12 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
char *states[] = {
|
char *states[] = {
|
||||||
"California", "Oregon",
|
"California", "Oregon",
|
||||||
"Washington", "Texas",
|
"Washington", "Texas"
|
||||||
NULL
|
|
||||||
};
|
};
|
||||||
char *state = "";
|
int num_states = 4;
|
||||||
|
|
||||||
for(i = 0; NULL != (state = states[i]); i++) {
|
for(i = 0; i < num_states; i++) {
|
||||||
printf("state %d: %s\n", i, state);
|
printf("state %d: %s\n", i, states[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user