OK, I\'m having trouble understanding pointers to pointers vs pointers to arrays. Consider the following code:
char s[] = \"Hello, World\";
char (*p1)[] = &s
Here's the sample that works, plus printouts of pointer addresses to make things simple to see:
#include
char s[] = "Hello, World";
char (*p1)[] = &s;
char *p2 = (char*)&s;
int main(void)
{
printf("%x %x %x\n", s, p2, *p2);
printf("%x\n", &s); // Note that `s` and `&s` give the same value
printf("%x\n", &s[0]);
printf("%c\n", **p1);
printf("%c\n", *p2);
}