Re: How to increment array of pointers to strings
- From: Keith Thompson <kst-u@xxxxxxx>
- Date: Wed, 04 Aug 2010 15:50:50 -0700
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"
.
- Follow-Ups:
- Re: How to increment array of pointers to strings
- From: Morris Keesan
- Re: How to increment array of pointers to strings
- From: pete
- Re: How to increment array of pointers to strings
- References:
- How to increment array of pointers to strings
- From: barncat
- Re: How to increment array of pointers to strings
- From: Ben Bacarisse
- Re: How to increment array of pointers to strings
- From: barncat
- How to increment array of pointers to strings
- Prev by Date: Re: volatile Info
- Next by Date: Re: volatile Info
- Previous by thread: Re: How to increment array of pointers to strings
- Next by thread: Re: How to increment array of pointers to strings
- Index(es):
Relevant Pages
|