> On Mar 18, 2024, at 1:52 PM, Michael Van Canneyt via fpc-pascal > <fpc-pascal@lists.freepascal.org> wrote: > > An ansistring is a pointer to a memory block. > > You are printing the address of S1 and the address of S, i.e. the address of > the pointer itself, not the address of what S (or s1) points to. Obviously > the address of the s is different of s1. > > What you want to do is print hexstr(pointer(s)) > if you do that, you'll have the same output 3 times.
Oh, it's a pointer to a pointer? I guess that explains how it can resize itself and not invalidate shared references, if those are even possible with AnsiString. Regards, Ryan Joseph _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal