LabWindows/CVI

Content Type
Programming Language
Current manual
Table of Contents

memcmp

memcmp

int memcmp (const void *buffer1, const void *buffer2, size_t numberOfBytes);

Purpose

Compares two blocks of memory. A specified number of bytes starting from the beginnings of the memory blocks are compared. The comparison is based upon the unsigned char values stored in the bytes of the buffers. The comparison is case-sensitive.

Parameters

Input
Name Type Description
buffer1 const void * Contains a pointer to the memory block that is compared to the memory block specified in buffer2.
buffer2 const void * Contains a pointer to the memory block that is compared to the memory block specified in buffer1.
numberOfBytes size_t Specifies the number of initial bytes that are used in the comparison.

Return Value

Name Type Description
comparisonResult int Contains the comparison result returned by the function. The following describes the possible return values:
Result Description
Positive integer buffer1 is greater than buffer2
Zero buffer1 is equal to buffer2
Negative integer buffer1 is less than buffer2

Additional Information

Library: ANSI C Library

Include file: ansi_c.h

LabWindows/CVI compatibility: LabWindows/CVI 3.0 and later

Was this information helpful?

Previous

memmove

Next

memset

Previous

memmove

Next

memset