How to increment array of pointers to strings
- From: barncat <thebarncat@xxxxxxxxx>
- Date: Wed, 4 Aug 2010 10:37:19 -0700 (PDT)
I am trying to increment the pointer of this array, similar to
incrementing *argv[]:
*++argv
printf("%s\n", *argv); /* now prints the arg at argv[1]; */
--
code:
char *args[8];
args[0] = "x";
args[1] = "y";
args[2] = "z";
/* if i use:
args++; or
*args++;
i get error:
xxx.c:18: error: wrong type argument to increment
*/
--
how can i increment the pointer and print the contents of the current
location of it?
Thanks
.
- Follow-Ups:
- Re: How to increment array of pointers to strings
- From: Denis McMahon
- Re: How to increment array of pointers to strings
- From: Ben Bacarisse
- Re: How to increment array of pointers to strings
- Prev by Date: Re: strtok()
- Next by Date: Re: volatile Info
- Previous by thread: Re: Yet another binary search tree library
- Next by thread: Re: How to increment array of pointers to strings
- Index(es):
Relevant Pages
|