Dereference operator

From Wikipedia, the free encyclopedia

The dereference operator or indirection operator, "*", is a unary operator found in C-like languages that include pointer variables. It operates on a pointer variable, and returns an l-value equivalent to the value at the pointer address. This is called "dereferencing" the pointer. The following is an example:

int x = 0;
int *pointer_to_x = &x;
(*pointer_to_x) += 1;

The above C code increments the variable x by using the indirection operator and a pointer to the variable x.

[edit] See also

Segmentation fault