Adding in comments to match example code
This commit is contained in:
parent
2e571b4641
commit
a3133a8672
3
ex10.c
3
ex10.c
@ -4,10 +4,13 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
||||||
|
// go through each string in argv
|
||||||
|
// why am I skipping argv[0]?
|
||||||
for(i = 0; i < argc; i++) {
|
for(i = 0; i < argc; i++) {
|
||||||
printf("arg %d: %s\n", i, argv[i]);
|
printf("arg %d: %s\n", i, argv[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// let's make our own array of strings
|
||||||
char *states[] = {
|
char *states[] = {
|
||||||
"California", "Oregon",
|
"California", "Oregon",
|
||||||
"Washington", "Texas"
|
"Washington", "Texas"
|
||||||
|
Loading…
Reference in New Issue
Block a user