There are four arithmetic operators that can be used on pointers:
Pointers arithmetic is not same as normal arithmetic i.e. if you want to add 1 to any no. then you will get that no. after adding 1 in it. But in Pointers it is a bit different as: Base Address : The first byte address of any variable is known as base address. It means suppose you have int type variable then it's size in my architecture is 4 byte (It may vary in yours) then 4 consecutive blocks will be created in RAM. So when we will point it with any pointer variable at that time the address of 1 block of 4 will come in that pointer variable. It means base address is the first block address of any data type variable.
// E.g:
int a, b, *p, *q;
&a*&b; // Not Possible
&a+&b; // Not Possible
p*q; // Not Possible
// E.g :
&a*5; // Not Possible
p/5; // Not Possible
// E.g :
int a,b; // Let's Suppose &a is 1000
int *p, *q;
p=&a;
q=&b;
p+1; // It is possible [1000+1 = 1004]
Basically when we do
int a = 2;
a++; → 3
But in pointer
int *ptra = &a;
ptra = ptra + 1;
Now here it will add size of ptra (size of int)
#include <stdio.h>
int main()
{
int a = 34;
int *ptra = &a;
printf("%d", ptra); // lets say this is x
printf("\n%d", ptra+1); // so this prints x+4, cuse that's the size of int
return 0;
} //we can use other operator too.
Output
3456780
3456784