Clib Compare Memory Method
The Clib Compare Memory method compares the contents of two buffers. It returns one of the following values:
If the value in the buf1 argument is less than the value in the buf2 argument, then it returns a negative number.
If the value in the buf1 argument is greater than the value in the buf2 argument, then it returns a positive number.
If the value in the buf1 argument is the same as the value in the buf2 argument, then it returns 0.
Format
Clib.memcmp(buf1, buf2[, length])
The following table describes the arguments for the Clib Compare Memory method.
Argument | Description |
---|---|
buf1 |
A variable that contains the name of a buffer. |
buf2 |
A variable that contains the name of a buffer. |
length |
The number of bytes that this method compares. It does one of the following depending on how you specify the length argument:
If one buffer is shorter than the other buffer, then it compares the buffers from the beginning byte up to the length of the shorter buffer. |