J
jski
Is p declared as a 2D array, p[m][n], essentially the same as **p? If
I try declararing p in main() as p[m][n] and then pass it as an
argument to a routine (function) with corresponding parameter **p, I
get "incompatible pointer type". If I declare the corresponding
parameter as (*p)[m], it works.
If I declare p in main() as **p and do the double nested for-loops
malloc()'ing one row at a time and then use double indexing, [][], to
access and assign elements malloc{}'ed ealier, it works fine.
So to sum it up, p declared as p[m][n] is not the same as **p
sometimes but is other times?
---John
I try declararing p in main() as p[m][n] and then pass it as an
argument to a routine (function) with corresponding parameter **p, I
get "incompatible pointer type". If I declare the corresponding
parameter as (*p)[m], it works.
If I declare p in main() as **p and do the double nested for-loops
malloc()'ing one row at a time and then use double indexing, [][], to
access and assign elements malloc{}'ed ealier, it works fine.
So to sum it up, p declared as p[m][n] is not the same as **p
sometimes but is other times?
---John