CompareMem - C++ Builder

C++ Builder 参考手册 ➙ System::Sysutils ➙ CompareMem


比较两块内存的内容是否相同

头文件:#include
命名空间:System::Sysutils
函数原型:

bool __fastcall CompareMem(void * P1, void * P2, int Length);

参数:

  • P1:要比较的内存地址1;
  • P2:要比较的内存地址2;
  • Length:字节数;

返回值:

  • ture:内存 P1 和 P2 的 Length 个字节的内容相同;
  • false:内存 P1 和 P2 的 Length 个字节的内容不同;
  • 如果 Length ≤ 0 直接返回 true;
  • 和字符串比较不同的是,内存比较不会因为遇到字节 0 而停止比较。

相关:

  • System::Sysutils::AnsiCompareFileName
  • System::Sysutils::AnsiCompareStr
  • System::Sysutils::AnsiCompareText
  • System::Sysutils::AnsiStrComp
  • System::Sysutils::AnsiStrIComp
  • System::Sysutils::AnsiStrLComp
  • System::Sysutils::AnsiStrLIComp
  • System::Sysutils::CompareMem
  • System::Sysutils::CompareStr
  • System::Sysutils::CompareText
  • System::Sysutils::StrComp
  • System::Sysutils::StrIComp
  • System::Sysutils::StrLComp
  • System::Sysutils::StrLIComp
  • System::Sysutils::WideCompareStr
  • System::Sysutils::WideCompareText
  • System::Sysutils
  • memcmp, _fmemcmp, _tmemcmp, wmemcmp
  • memicmp, _fmemicmp
  • strcmp, _strcmp, _fstrcmp, _tcscmp, wcscmp
  • strncmp, _fstrncmp, _tcsncmp, _tcsnccmp, wcsncmp
  • stricmp, _stricmp, _fstricmp, strcmpi, _strcmpi, _tcsicmp, _tcscmpi, _wcsicmp, wcscmpi, _wcscmpi
  • strnicmp, _strnicmp, _fstrnicmp, strncmpi, _tcsnicmp, _tcsncicmp, _tcsncmpi, _wcsnicmp, wcsncmpi, _wcsncmpi

C++ Builder 参考手册 ➙ System::Sysutils ➙ CompareMem

你可能感兴趣的:(CompareMem - C++ Builder)