On Wed, Jul 13, 2005 at 01:28:14AM +0200, Falk Hueffner wrote: > Joe Buck <[EMAIL PROTECTED]> writes: > > If you want to be pedantic, that's not portable; in particular, it > > will break for some of the memory models used with 16-bit Windows > > You're missing my point; size_t was just an example, whoever does this > will know what the correct type is for their system.
I'm afraid that my grey hairs give me an advantage here. You're missing my point; *there is no correct size*! In segmented memory models, the pointers are only offsets in the current segment; casting them to any integer type you choose simply will not work. Casting to size_t (or any other integral type large enough to hold the pointer) never gives any advantage over comparing the pointers directly.