they are all array notation but
char** val
is implicite andchar* val[]
is explicite
It's the other way around. They are all pointers, and the [] option is syntactic sugar to highlight the intention that the parameter is an array. But also note that this equivalence only applies to the first dimension of a the array notation. All subsequent dimensions require a size and represent array types. Consider this:
int main()
{
int a[2][4];
foo(a);
}
foo() must be declared in one of two ways:
void foo(int a[][4]); /* First dimension decays into a pointer */
void foo(int (*a)[4]); /* Explicitly stating the first dimension as a pointer */
It's a common misconception that the double pointer type corresponds to a 2D array, which is false:
void foo(int **a); /* Fails to compile */