Guardian Native C Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)
Guardian Native C Library Calls (j - m) memcmp(3)
NAME
memcmp - Compares characters in memory
LIBRARY
G-series native Guardian processes: $SYSTEM.SYSnn.ZCRESRL
G-series native OSS processes: /G/system/sysnn/zcresrl
H-series and J-series native Guardian processes: $SYSTEM.ZDLLnnn.ZCREDLL
32-bit H-series and J-series OSS processes: /G/system/zdllnnn/zcredll
64-bit H-series and J-series OSS processes: /G/system/zdllnnn/ycredll
SYNOPSIS
#include <string.h>
int memcmp(
const void *s1,
const void *s2,
size_t n);
PARAMETERS
s1 Points to the location of a destination string.
s2 Points to the location of a source string.
n Specifies the number of bytes to search.
DESCRIPTION
The memcmp() function operates on strings in memory areas. A memory area is a group of con-
tiguous bytes bound by a count and not terminated by a null character.
The memcmp() function compares the first n bytes, which are converted to unsigned char,of
the string pointed to by the s1 parameter with the first n bytes (also interpreted as unsigned char)
of the string pointed to by the s2 parameter.
NOTES
The memcmp() function uses native byte comparison, which might have signed values on some
machines.
RETURN VALUES
The memcmp() function returns one of the following values:
Less than 0 When s1 is less than s2
Equal to 0 When s1 is equal to s2
Greater than 0 When s1 is greater than s2
RELATED INFORMATION
Functions: memccpy(3), memcpy(3), memchr(3), memmove(3), memset(3), strcat(3).
527192-018 Hewlett-Packard Company 4−99