I know that this topic has been discussed a lot, still I'd appreciate a clear cut (and correct) answer: I pass a multidimensional array to a function, which is defined as int f(int a[10][10]) { int *b=(void*)a; int *c=a[0]; /*...*/ } Now the questions come: - Is it guaranteed that b and c points to the same object (or is this ...
"John den Haan" I was wondering how I can pass a pointer to a 2D-array (declared with a malloc-construct) as if it were a continuous 1D-array of the size (rows*cols)? Is this at all possible, and if so, how? That depends upon exactly what your 'malloc-construct' is. Each (successful) call to 'malloc()' allocates a ...