In C, why can't I write:
char **expectedPINs01 = { "0", "5", "7", "8", "9" };
Cause I got:
warning: initialization of ‘char **’ from incompatible pointer type ‘char *’
But it is possible to write:
char *expectedPINs01[] = { "0", "5", "7", "8", "9" };
What's the difference?
printf("%c\n", 1["hello"]);
compiles with no complaints even with-Wall
and printse\n
. The number1
is obviously not an "array", yet the [] shorthand happily does its work and produces 1 plus the address of theh
to yielde
.