
538 Pointers
Explanation: In the above program using pointers, the value of the variable x is first increased
and then decreased.
13.5 POINTER TO POINTER
Pointer to pointer is a pointer that stores the ad-
dress of another pointer. There can be a chain of pointers
depending on applications/requirements. In Figure 13.3, x
is a simple variable, p is a pointer to the variable x, and q is
a pointer to x. The values of variables ‘x,* p, and **q’ are
shown in the boxes, and their addresses are shown outside
the boxes.
x
∗
p **q
65524 65522 65520
10 65524 65522
Fig. 13.3 Pointer to pointer
cout<<“\n Value of x:”<<*p;
*p=*p-2;
cout<<“\n Value of x:”<<*p; ...