www.delorie.com/djgpp/doc/libc-2.01/libc_52.html   search  
Go to the first, previous, next, last section, table of contents.


bcmp

Syntax

#include <string.h>

int bcmp(const void *ptr1, const void *ptr2, int length);

Description

Compare memory pointed to by ptr1 and ptr2 for at most length bytes.

Return Value

The number of bytes remaining when the first mismatch occurred, or zero if all bytes were equal.

Example

void f(char *s1, char *s2)
{
  int l = bcmp(s1, s2, strlen(s1));
  printf("Difference: %s, %s\n", s1+strlen(s1)-l, s2+strlen(s1)-l);
}


Go to the first, previous, next, last section, table of contents.

  webmaster   donations   bookstore     delorie software   privacy  
  Copyright © 1997   by DJ Delorie     Updated Apr 1997  

Please take a moment to fill out this visitor survey
You can help support this site by visiting the advertisers that sponsor it! (only once each, though)