strcmp

OS/161 Reference Manual

Name

memcmp - compare memory blocks

Library

Standard C Library (libc, -lc)

Synopsis

#include <string.h>

int
memcmp(const void *block1, const void *block2, size_t len);

Description

The two memory regions block1 and block2, both of length len, are compared lexicographically.

Return Values

If block1 sorts before block2, -1 is returned.

If block1 sorts after block2, 1 is returned.

If block1 is the same as block2, 0 is returned.

The sort order used is derived from the natural ordering of the numerical values of (unsigned) characters.