Re: How to increment array of pointers to strings



barncat <thebarncat@xxxxxxxxx> writes:
[...]
Thanks. The array is actually a ptr to an array of strings, like:
char *name[] = { "one","two","three" };
which yes, i guess is different than **argv.
sorry, i am just confused trying to learn. I guess i could make it an
** object like argv and work with it that way.

Given the above declaration, name is a pointer to the first element
of an array of char*, where each char* happens to point to (the
first character of) a string. (A pointer to an array is not the same
as a pointer to the array's first element.)

Remember: in spite of several features of C that seem to conspire
to make you think otherwise, arrays are not pointers, and pointers are
not arrays.

Recommended reading: section 6 of the comp.lang.c FAQ,
<http://www.c-faq.com>.

--
Keith Thompson (The_Other_Keith) kst-u@xxxxxxx <http://www.ghoti.net/~kst>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
.