[ First ]  [ Previous ]  [ Next ]  [ Last ]  [ Manuals ]


memcmp

Compare two blocks of memory.

Compatibility:

This function is compatible with the following targets:

ANSI

BeOS

EMB/RTOS

Mac OS

Palm OS

Win32


Prototype:
#include <string.h>
int memcmp(const void *s1, 
   const void *s2, size_t n);
Parameters:

Parameters for this facility are:

s1  
const void *  
The memory to compare  
s2  
const void *  
The comparison memory  
n  
size_t  
The maximum length to compare  

Remarks:

The memcmp() function compares the first n characters of s1 to s2 one character at a time.

Return:

memcmp() returns a zero if all n characters pointed to by s1 and s2 are equal.

memcmp() returns a negative value if the first non-matching character pointed to by s1 is less than the character pointed to by s2.

memcmp() returns a positive value if the first non-matching character pointed to by s1 is greater than the character pointed to by s2.

See Also:

"strcmp"

"strncmp"

For example of memcmp() usage:
Refer to"Example of memchr() usage.".


[ First ]  [ Previous ]  [ Next ]  [ Last ]  [ Manuals ]

Visit the Metrowerks website at: http://www.metrowerks.com
For assistance contact Metrowerks Technical Support at: cw_support@metrowerks.com
Copyright © 2000, Metrowerks Corp. All rights reserved.

Last updated: August 16, 2000