Consider the following code:
char* p = new char[2];
long* pi = (long*) p;
assert(p == pi); // OK
char* p1 = &p[1];
long* pi1 = (long*) p1;
asser
The difference between two pointers is undefined if the pointers do not point to the same array, or if the pointers were typecast from pointers to an unrelated type.
Also, the difference is not in bytes but is in the number of elements.
In your second case the difference is 1 byte, but it is being divided by sizeof(long). Note that because this is undefined behavior, absolutely any answer here would be correct.