#include <strings.h>
|
|
int
bcmp (const void *b1, const void *b2, size_t len); |
bcmp function returns 0 if the byte sequences are equal, otherwise a non-zero result is returned.
The strings may overlap.
#include <string.h>
#include <stdio.h>
int main()
{
int ret = 0;
ret = bcmp("a","a",1);
printf("bcmp(\"a\",\"a\",1) is %d",ret);
ret = bcmp("abcd","abce",4);
printf("\nbcmp(\"abcd\",\"abce\",1) is %d",ret);
ret = bcmp("abc","xyz",0);
printf("\nbcmp(\"abc\",\"xyz\",0) is %d",ret);
return 0;
}
Output
bcmp("a","a",1) is 0
bcmp("abcd","abce",1) is -1
bcmp("abc","xyz",0) is 0
|
© 2005-2007 Nokia |