informix
INFORMIX-ESQL/C Programmer's Manual
ESQL/C Function Library

bycmpr()

The bycmpr() function compares two groups of contiguous bytes for a given length. It returns the result of the comparison as its value.

Syntax

Usage

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.

Return Codes

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.

Example

This sample program is in the bycmpr.ec file in the demo directory.

Output


INFORMIX-ESQL/C Programmer's Manual, Version 9.21
Copyright © 1999, Informix Software, Inc. All rights reserved