According to : The C Book — Introduction
The idea as it seems to me is to find out the distance (in bytes(?)) between two addresses.Subtracting one pointer from another gives a result whose type differs between different implementations. To allow safe use of the difference, the type is defined in <stddef.h> to be ptrdiff_t. Similarly, you can use size_t to store the result of sizeof.
Why would the `difference` between different types of pointers have different types ?
The next paragraph talks about a macro called offsetof for finding the offset of structure members. What is the difference between using it and simply ( *object - *member ) ?