There is no such function. memcmp compares two pointers in memory to
see if the referenced bytes are the same. This can't be done in C# because
you can not guarantee that a location in memory will always have the same
contents (because of memory management).
However, if you have two byte arrays, you could easily write a routine
that will cycle through the arrays and compare the bytes.
If you have an IntPtr either via fixing the memory via the "fixed" verb
or via the GCHandle.AddrOfPinnedObject() method you can then populate it
via the Marshal.Copy() method.
-
Stephen
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.