Function memcmp

Top 

Declaration:

int memcmp(void s1[], void s2[], int n, int s1_index=0, int s2_index=0);

Description

The memcmp function compares the first n bytes of objects s1 and s2 and returns the comparison result. The bytes are interpreted as the unsigned char.

      Result             Meaning

      -----------------------------------------

      < 0                s1 is less than s2

      = 0                but1 is equal to s2

      > 0                s1 is greater than s2

Returned value

The memcmp function returns the positive, negative, or zero value depending on the result of comparing the first n bytes of objects s1 and s2.