#include #include int main() { int a=5; int b=8; int* p; // pointer to int int* q; // pointer to int // initialize the pointers p = &a; // p points to a (or the memory address where a is stored) q = &b; // q points to b (or the memory address where b is stored) printf("Before: a=%d, b=%d \n", a, b); printf("Before: *p=%d, *q=%d \n", *p, *q); p = q; // make p point to the same memory location as q // this is equivalent to p = &b; printf("After: a=%d, b=%d \n", a, b); printf("After: *p=%d, *q=%d \n", *p, *q); system("pause"); }