I have the following question; If a is an int array with 10 Element I can define pointers
int*b=&a[3];
int*c=&[2];
I can then do arithmetic operations with these pointers like int d=a-c; which will return the number of int values in the array between b and c. So my question is if I am also allowed to do such pointer arithmetic operations for any variables which may not be in an array. For example:
int a=10;
int b=20;
int*c=&a;
int* d=&b;
and then do int e=d-c; or int*e=c+1;
The reason I ask is that I have received conflicting information about whether this leads to undefined behaviour,
intb=&a[3]andintc=&a[2]are not not syntatically correct.