char *p ;
which means to define a variable called
pwhich will normally hold the address of some character. The syntax is meant to indicate the the expression
*pshould be a character. In fact, that identifies the first aspect of using pointers. The
*operator dereferences a pointer, which means that the value of the expression
*pis the character to which
ppoints. For example, the code fragment
*p = 'b' ; printf( "%c\n", *p ) ;
would set the character to which
ppoints to be the character
'b'and would then print it out. This illustrates that a dereferenced pointer may be used anywhere any other variable or expression of that type may be used.
Which of these are valid pointer (variable) declarations?