*
acts as a dereference operator only in an expression.
The (admittedly odd) syntax of C declarations is based on the idea that "declaration follows use". So these declarations:
int i;
int *p;
can be read as "i
is an int
" and *p
is an int
. Since *p
is an int
, then p
must be a pointer-to-int
.
(Of course *
is also the multiplication operator if it appears with two operands.)