English
Language : 

CC78K4 Datasheet, PDF (220/523 Pages) NEC – CC78K4 Ver.2.30 or Later, C Compiler 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.
220
User’s Manual U15556EJ1V0UM