Borland C++ reference

memicmp, _fmemicmp

raw OCR

Compares n bytes of two character arrays, ignoring case.

Defined in header <mem.h>

Syntax

#include <mem.h>
Near  version: int memicmp(const     void *sl, const void  *sZ, sizet n);
Far version: int far _fmemicmp(const     void  far *sl, const void far *s2,
                                   size_t n)

Portability

DOSUNIXWindowsANSI CC++ only
Near version ■■■
Far version ■■

Remarks

memicmp is available on UNIX System V systems.

memicmp compares the first n bytes of the blocks si and s2, ignoring character case (upper or lower).

Return value

memicmpreturns a value

< 0 if s2 is less than s2 = 0 if s2 is the same as s2 > 0 if s2 is greater than s2

See also

Example

#include <stdio.h>
#include <string.h>

int main(void)
{
   char *bufl = "ABCDE123";
   char *buf2 = "abcde456";
   int Stat;
   Stat = memicmp(bufl, buf2, 5);
   printfC'The strings to position 5 are  ")
   if (Stat)
      printfC'not ");
   printfC'the same\n");
   return 0;

Differences from modern implementations

Nothing recorded yet.

Modern references

These are search links, not yet checked by hand.

Extraction notes

  • heading `memicmp, Jmemicmp` read as `memicmp, _fmemicmp`