1

Pretty much what the title says. When I declare a function

void foo(int *x[])

x is considered as a parameter of type int**, what about the second case?

EDIT

The part that I didn't understand was why couldn't I pass a 2D massive using a function with parameter type of int * [], but managed to do it using int ( * )[]. I thought that if the name of an array was converted to a pointer to its first element, then the name of a 2D array would be converted to a pointer of the pointer of its first element, that being said a 2D array is a massive of pointers. And int (*)[] means I am passing a pointer to an integer array. So I'm confused.

TPAXATb
  • 11
  • 2
  • Link: http://stackoverflow.com/questions/27890375/int-vs-int-vs-int-in-function-parameters-which-one-should-i-use – Omid CompSCI Feb 10 '17 at 18:58
  • To the title: http://stackoverflow.com/questions/859634/c-pointer-to-array-array-of-pointers-disambiguation – P.P Feb 10 '17 at 19:27
  • To your question about passing array to a function. See: http://stackoverflow.com/questions/1461432/what-is-array-decaying – P.P Feb 10 '17 at 19:29
  • Possible duplicate of [What is array decaying?](http://stackoverflow.com/questions/1461432/what-is-array-decaying) – Blackbam Feb 10 '17 at 21:02

0 Answers0