P
pandapower
Hi,
I know about the equivalence of pointer and arrays.But my doubt
comes when its for multidimentional arrays.I have read the C faq but
still have some doubts.
Suppose I have a declaration as
1. char array[x][x] or char array[][x]
and it will get decayed to
2. char *array[x]
similarly if I have a declaration as
3. char *argv[]
it can decay to
4. char **argv
Though its at our prerogative the way we use it.
Now from the above cases we see that,
1. 2 dimentional array can get decayed to an array of char pointers.
2. An array of char pointers can also be used as a pointer to pointer.
If I am correct till now, what I mean to know is that though we have
the cases above,a 2 dimentional array can never directly decay to a
pointer to pointer.
Correct me if I am wrong.
regards
pandapower
I know about the equivalence of pointer and arrays.But my doubt
comes when its for multidimentional arrays.I have read the C faq but
still have some doubts.
Suppose I have a declaration as
1. char array[x][x] or char array[][x]
and it will get decayed to
2. char *array[x]
similarly if I have a declaration as
3. char *argv[]
it can decay to
4. char **argv
Though its at our prerogative the way we use it.
Now from the above cases we see that,
1. 2 dimentional array can get decayed to an array of char pointers.
2. An array of char pointers can also be used as a pointer to pointer.
If I am correct till now, what I mean to know is that though we have
the cases above,a 2 dimentional array can never directly decay to a
pointer to pointer.
Correct me if I am wrong.
regards
pandapower