Standard C Functions


memcmp


Syntax

#include <string.h>
int memcmp(const void *buf1, const void *buf2, size_t count)

Arguments

buf1      pointer to the buffer to be compared to buf2
buf2      pointer to the buffer to be compared to buf1
count     number of bytes to compare

Return Value

A value less than zero    --> buf1 is less than the content of buf2
A value equal to zero     --> buf1 is equal to the content of buf2
A value greater than zero --> buf1 is greater than the content of buf2

Description

It compares the content of the buf1 buffer with the content of the buf2 buffer for the number of bytes specified by count.