MEMCMP - compare parts of two strings.
i = memcmp( s1, s2, N );
- const void *s1, *s2;
- are the strings to be compared.
- size_t N;
- gives the number of characters to be examined.
- int i;
- gives the results of the comparison. "i" is
zero if the first N characters of the strings are
identical. "i" is positive if string
"s1" is greater than string "s2", and
is negative if string "s2" is greater than
string "s1". Comparisons of "greater
than" and "less than" are made according
to the ASCII collating sequence.
"memcmp" compares the first N characters of the
string "s1" to the first N characters of the string
Unlike the function "strncmp", "memcmp"
does not check for a '\0' terminating either string. Thus it
examines a full N characters, even if the strings are not
actually that long.
expl c lib strncmp
expl c lib strcmp
Copyright © 1996, Thinkage Ltd.