This topic is now archived and is closed to further replies.

memcmp in delphi

This topic is 5314 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

From the delphi help


Performs a binary comparison of two memory images.

Unit - Sysutils

function CompareMem(P1, P2: Pointer; Length: Integer): Boolean; assembler;

CompareMem performs a binary compare of Length bytes of memory referenced by P1 to that of P2. CompareMem returns True if the memory referenced by P1 is identical to that of P2.

Hope it helps


Share this post

Link to post
Share on other sites
I found the function just after i created this thread. But i dont get the function to work like i want to!


..this returns true but...

struct2 := struct1;
CompareMem(@struct1, @struct2,sizeof(TStruct));

..returns false...

And now i need to compare two diffrent objects from the same record.

How? :o

Share this post

Link to post
Share on other sites