[DllImport("msvcrt.dll", SetLastError=true)]
static extern int memcmp(IntPtr ptr1, IntPtr ptr2, int count);
[DllImport("msvcrt.dll", SetLastError=true)]
static extern unsafe int memcmp(void* ptr1, void* ptr2, int count);
Do you know one? Please contribute it!
None.
Please add some!
//http://www.cplusplus.com/reference/clibrary/cstring/memcmp/
unsafe bool CompareByteArray(byte[] b1, byte[] b2)
{
fixed (byte* p1 = b1)
fixed (byte* p2 = b1)
{
return memcmp((void*)p1, (void*)p2, b1.Length) == 0;
}
}