I can't seem to understand why I am getting this error. It seems bizarre to me that subtraction works just fine (producing -3) while addition gives me an error.
Why is this the case?, Shouldn't addition return (0x00000001 + 0x00000002 = 0x00000003)?
#include <stdio.h>
int main()
{
int* x = NULL;
int* y = NULL;
// error: invalid operands to binary + (have ‘int *’ and ‘int *’)
int z = &x[0] + &x[3];
// but this works fine
int z = &x[0] - &x[3];
printf("0x%08x\n", x);
printf("0x%08x\n", &x[0]);
printf("%d", z);
return 0;
}