Re: How to increment array of pointers to strings
- From: barncat <thebarncat@xxxxxxxxx>
- Date: Wed, 4 Aug 2010 11:45:56 -0700 (PDT)
When [] appear in a parameter declaration, it really means *. I.e. argv
is really a char ** object. Your args is actually an array, so to get
the same effect you need a pointer to the first element of it and then
you can work with that. Of course, there's no reason to use a pointer
at all. An index will work just as well.
--
Ben.
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.
thanks
.
- Follow-Ups:
- Re: How to increment array of pointers to strings
- From: Keith Thompson
- Re: How to increment array of pointers to strings
- From: Ben Bacarisse
- Re: How to increment array of pointers to strings
- From: Vincenzo Mercuri
- 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
- 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
|