YeXo wrote:
Adding numbers to pointers always confuses me.
Don't think of them as "adding numbers to pointers", consider them as "indexing an array".
[tt]*(ptr+4)[/tt] is semantically identical to [tt]ptr[4][/tt], whatever type [tt]ptr[/tt] might have. That means when computing "ptr + 4" your compiler actually produce an that is 4*sizeof(*ptr)
bytes farther than the address of ptr.
Thus on a machine where "long int" is 4 bytes, "long_int_ptr++" do advance the pointer to the next long int ...
and, btw, i don't know what code has output the line
ptr points to the value: 0x14
but ptr doesn't point to "value 0x14". it points towards "address 0x14" (which is very unlikely to be a valid address anyway
)