+ 1

What is the problem

GNU nano 6.0 ch.c #include <stdio.h> int main() { char *arg[] = {"One", "Two", "Three"}; char ** argg; argg = &arg; printf("\n%s\n", **argg[0]); argg++; printf("\n%s\n", **argg[0]); return 0; }

25th Jan 2022, 6:46 PM
Clov
2 Answers
+ 4
ChingBling it looks like all your references and de-references are one or two levels too deep. Back out of all levels and it works: argg = arg; printf("\n%s\n", argg[0]); argg++; printf("\n%s\n", argg[0]); Output: One Two
25th Jan 2022, 7:42 PM
Brian
Brian - avatar
+ 3
Thanks for the help
25th Jan 2022, 7:51 PM
Clov