The Dereferencing Operator

The unary prefix operator * takes a pointer and yields the variable it points to.

int x;
int *a;

x = 42;
a = &x;
printf("%d\n", *a);   /* prints x (42) */
*a = 13;              /* assigns 13 to x */
printf("%d\n", x);    /* prints 13 */

Note: * is inverse of &, so that *(&x) == x.

Index