I'm using a memory editing application known as Cheat Engine. I attach Cheat Engine to a game. In my game, I have a 32-bit integer known as HP. HP is stored at a memory address A. If I restart my game, HP is stored at a new memory address B. It seems that using Cheat Engine, I can do a pointer scan and find a static memory address, C, that points to another memory address and its accompanying offset, D and offset, so that [D + offset] always stores HP's memory address during that session. So if I dereference [D + offset], I always get the memory address that stores HP.
Here is a diagram:
A or B --> HP
D + offset --> A or B
C --> D
What is the benefit of using offsets? Why can't C just point to A or B directly? I'm familiar that using offsets are beneficial when dealing with arrays in the C language. Does that mean that whenever I see an offset to a pointer, the pointer is pointing to the first element in an array and the offset is referring to one of the elements in the array?