Guardian Native C Library Calls Reference Manual (G06.28+, H06.04+)

memcmp(3) Guardian Native C Library Calls Reference Manual
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 native Guardian processes: $SYSTEM.ZDLLnnn.ZCREDLL
H-series OSS processes: /G/system/zdllnnn/zcredll
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 Species 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 rst n bytes, which are converted to unsigned char,of
the string pointed to by the s1 parameter with the rst 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).
450 Hewlett-Packard Company 527192-005