memcmp

Compares two memory blocks.

int memcmp (void * buf1, void * buf2, size_t length);

Required Header
<string.h>

Return Value

This function returns a number specifying the relationship between the two memory blocks:

< 0 : buf1 is less than buf2
= 0 : buf1 is equal to buf2
> 0 : buf1 is greater than buf2

Parameters

buf1

  The first memory block

buf2

  The second memory block

length

  The length of the memory blocks

String

See Also    bcopy, memccpy, memchr, memcpy, _memicmp, memmove, memset, strcpy, strncpy