Re: How to increment array of pointers to strings

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.


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.


Relevant Pages

  • Re: char **argv & char *argv[]
    ... "pointer to pointer to char". ... >> pointer)) pointing to the first element of an array. ... so we have to start adding more context. ... type "pointer to char", rather than "array MISSING_SIZE of char". ...
  • Re: lvalues and rvalues
    ... array, a pointer to the first element of the array, and a pointer ... I can't see how a pointer to a single object in an array ...
  • Re: difference between x[10] and (*x)[10]
    ... is converted to pointer to the first element of the array. ... array is used it "decays" to a pointer to the first element. ... conversion to this pointer added in order to maintain ...
  • Re: Who owns the variable in my header file ?
    ... to check the subscripts to the array and trap on error conditions. ... cast one type of pointer into another; you wouldn't then be able to step ... language trying to be C like, ... One reason being that the programmer can possible ...
  • Re: Why C has Pointers.
    ... An array variable is not a constant: ... array's first element, and that pointer value cannot be modified. ... struct foo func{ ...