[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
memicmp() Compare Characters in Two Buffers
#include <memory.h> Required for declarations only
#include <string.h> Use either string.h or memory.h
int memicmp(buf1,buf2,cnt);
char *buf1; First buffer;
char *buf2; Second buffer;
unsigned cnt; Number of characters
memicmp() performs a case-insensitive lexicographic comparison of
'cnt' characters of 'buf1' and 'buf2'. memicmp() differs from
memcmp() in that case does not count in memicmp(); that is, 'a'
equals 'A' in memicmp().
Returns: A value indicating the relationship between the two
buffers:
Result Return Value
buf1 < buf2 < 0
buf1 == buf2 0
buf1 > buf2 > 0
-------------------------------- Example ---------------------------------
The following statements compares the first 35 characters of 'buffr1'
and 'buffr2'.
#include <memory.h>
char buffr1[30] = "Now is the time for all good men...";
char buffr2[30] = "NOW IS THE TIME FOR ALL GOOD MEN...";
int rslt;
main()
{
rslt = memicmp(buffr1,buffr2,35);
if (rslt == 0)
printf("buffers are equal");
else
printf("buffers are not equal");
}
See Also:
memcmp()
memcpy()
memset()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson