Pointers can be used for arithmetic and other operations just like regular variables. The four types of operations that can be carried out on pointers are as follows.
Pointer assignments
Pointer conversion
Pointer arithmetic
Pointer comparison
Pointer expression
When two pointers are assigned to each other, they both point to the same variable. So the assignment y = x; makes y point to the same variable as x. The variables are unaffected by pointer assignment. It only modifies one pointer such that it shares the same reference as another. After the pointer assignment, the two pointers are said to be "sharing" the variable.
This is presented below:
void main ( )
{
int n=10; *p, *q;
p=&n;
q=p;
printf(“%d%d%d”,n, *p, *q);
printf(“%p%p%p”,&n, p, p);
}
Pointer conversion
Pointer arithmetic
Pointer comparison
Pointer expression