I was under the impression that these two were the same, yet, after having problems doing this:
Code:
char **ptr;
char dd_arr[2][4]; // initialize with something here...
ptr = dd_arr; //compiler error: incompatible pointer types assigning to char **' from 'char [2][4]' [-Wincompatible-pointer-types]
I went on a google search that led me to believe they might be different after all.
I'm confused now. *ptr, holds the address of a pointer that holds the address of a char. Similarly, dd_arr[0] holds the address of an area in memory, where the address of a char is stored. I'm not understanding the difference. Why can I do *ptr = *dd_arr, but not ptr = dd_arr?
Thanks.