pointer to pointer and 2D arrays
is there a way to initialise a pointer to pointer to the 2D array?
char **p;
char (*q)[5];
I mean a pointer to an array to a 2D array, I know that. but what about the above? I was trying it out but I kept getting errors.
In case anybody is wondering, I'm just curious whether it's possible so that I could use or understand it when the time comes.
Please feedback.
Re: pointer to pointer and 2D arrays
Quote:
Originally posted by rfbu
is there a way to initialise a pointer to pointer to the 2D array?
char **p;
char (*q)[5];
Please feedback.
the above definitions are almost comletely different
char **p;
p is a pointer to pointer to char
you may use that as a 2D array with the proper
memory allocations.
char (*q)[5];
q is pointer to an 1-D 5 element char array.
hope this helps...