I recently embarrassed myself while explaining to a colleague why
char a[100];
scanf(\"%s\", &a); // notice a & in front of \'a\'
is ve
char [100]
is a complex type of 100 adjacent char
's, whose sizeof
equals to 100.
Being casted to a pointer ((void*) a
), this variable yields the address of the first char
.
Reference to the variable of this type (&a
) yields address of the whole variable, which, in turn, also happens to be the address of the first char