As others have pointed out, both work fine, and the wrong one actually has the advantage of syntactic economy.
The way I look at it, a declaration consists of type followed by the variable.
<type> <variable>;
int ii;
int* pii;
So, if you take away the variable, what remains is the type. Which is int and int* above. The compiler treats int* as a type internally (which is pointer to an int).
C, unfortunately, does not support this syntax seamlessly. When declaring multiple variables of the same type, you should be able to do this:
<type> <variable>, <variable>, <variable>;
which you cannot with a pointer type:
int* ii1, ii2, ii3;
declares ii1 of type int* and the rest of type int. To avoid this, I make it a habit of declaring only one variable per line.