A pointer variable is a variable. That is, its address value can change during program execution just as an integer value can change.
The advantage is that the same code can be executed more than once but produce different values or affect different locations by just changing the address in the pointer variable.
Here is an examle that demonstrates the technique (but not its true power).
void f(int *p) { *p = *p + 1; } int main() { int x = 5; int y = 10; f(&x); f(&y); // Now what is the value of x? of y? ... }
At the first call to function f, *p is an alias for main's x. At the second call, it is an alias for main's y.