English
Language : 

CC78K0S Datasheet, PDF (237/520 Pages) NEC – C Compiler Ver.1.30 or Later Language
CHAPTER 10 LIBRARY FUNCTIONS
6-4 memcmp
Character String/Memory Functions
FUNCTION
The memory function memcmp compares two data objects, with respect to a given number of characters.
HEADER
string.h
FUNCTION PROTOTYPE
int memcmp (const void *s1, const void *s2, size_t n);
Function
memcmp
Arguments
s1, s2 ... Pointers to two data
objects to be compared
n ... Number of characters to
compare
Return Value
• 0 if s1 and s2 are equal
• Positive value if s1 is
greater than s2; negative
value if s1 is less than s2
(s1 – s2)
EXPLANATION
• The memcmp function compares the data object pointed to by s1 with the data object pointed to by s2 with
respect to the number of bytes specified by n.
• If the two objects are equal, the function returns 0.
• The function returns a positive value if the object s1 is greater than the object s2 and a negative value if s1 is
less than s2.
User’s Manual U14872EJ1V0UM
237