You are subtracting two values of pointer type. This means that the result, as in C, is divided by the size of the object.
Instead, ensure that "offset" has an integral type, not a pointer type.
In the last example you are trying to subtract strings. You can't do that. Move the calls to "hex" from the computations to the prints and it will work.