Forum > General

Typed pointers = operator behavior?

<< < (2/2)

Yogi:
I dont think that {$T} will help in that case. But im sure this one will work correctly independant from the switch: Just cast the pointer to ptrint
 :-[

--- Code: ---if ptrint(pointer1)=ptrint(pointer2) then . . .
--- End code ---

Cyrax:

--- Quote from: Yogi on April 29, 2014, 11:08:26 pm ---Pointer-Arithmetik can be difficult
 On an Intel machine a pointer consitst of two values: Segment and Offset.
Different Segments and different Offsets can point to the same location but have different values (Seg:Ofs  in Decimals => 1000:0000 would be the same location as 0999:0001 but the pointer value is different). Therefore You first have to "normalize" the pointers to the same Seg and that is what Adr does in Your case.

--- End quote ---

This only applies if you are developing a 16-bit program. In 32-bit and 64-bit environments there is only offsets.

circular:
trn76, what do you see in the assembler window? (debug with a breakpoint on the line and open assembler window)

Navigation

[0] Message Index

[*] Previous page

Go to full version