On 2012-10-12, bintom <> wrote:
> I am trying to write a program with a function int** One2Two(int *a,
> int size, int (*A)[10]) that takes the address of a 1D int array (A1),
> the size of A1 and the address of a 2D int array (A2).
You are confused.
The parameter 'a' (or 'A1') is a pointer-to-int, or, likewise, the
address of an int; it's not the address of a 1D int array (but it
could be the address of the first element of such an array).
'A' (or 'A2') is a pointer to a 1D array (more precisely, a pointer
to an array of 10 ints), or, likewise, the address of such an array;
it's not the address of a 2D array.
Why is the return type of One2Two pointer-to-pointer-to-int when
the function does not return anything?
Have a look chapter 6 of the C language FAQ,
http://c-faq.com/aryptr/index.html