|
The bycmpr() function compares two groups of contiguous bytes for a given length. It returns the result of the comparison as its value.
The bycmpr() function performs a byte-by-byte comparison of the two groups of contiguous bytes until it finds a difference or until it compares length number of bytes. The bycmpr() function returns an integer whose value (0, -1, or +1) indicates the result of the comparison between the two groups of bytes.
The bycmpr() function subtracts the bytes of the byte2 group from those of the byte1 group to accomplish the comparison.
| 0 | The two groups are identical. |
| -1 | The byte1 group is less than the byte2 group. |
| +1 | The byte1 group is greater than the byte2 group. |
This sample program is in the bycmpr.ec file in the demo directory.