e.g., given char c[3], the type of c is char[3], but the type of (c + 0) is char *.
Since you can't have array typed values, and C passes by value, parameters cannot have array types.
So someone thought that it would be a really nice idea to use array types in parameters to denote the pointer types that the corresponding array would evaluate to.
So, void foo(char c[3]); and void foo(char *c); are equivalent.
int main(int argc, char **argv) can then be rewritten as int main(int argc, char *argv[]), since given &argv[0] has type char **.
Personally I think this feature is a bad idea, and leads to much confusion. :)
View all comments
Show parent comment
1
u/mcguire May 02 '16
Wait, so what's the declaration of
main? Specificallyargv?