home *** CD-ROM | disk | FTP | other *** search
/ PC Extra Super CD 1998 January / PCPLUS131.iso / DJGPP / V2 / DJLSR201.ZIP / src / libc / compat / bsd / bcmp.txh < prev    next >
Encoding:
Text File  |  1995-07-10  |  592 b   |  31 lines

  1. @node bcmp, memory
  2. @subheading Syntax
  3.  
  4. @example
  5. #include <string.h>
  6.  
  7. int bcmp(const void *ptr1, const void *ptr2, int length);
  8. @end example
  9.  
  10. @subheading Description
  11.  
  12. Compare memory pointed to by @var{ptr1} and @var{ptr2} for at most
  13. @var{length} bytes. 
  14.  
  15. @subheading Return Value
  16.  
  17. The number of bytes remaining when the first mismatch occurred, or zero
  18. if all bytes were equal. 
  19.  
  20. @subheading Example
  21.  
  22. @example
  23. void f(char *s1, char *s2)
  24. @{
  25.   int l = bcmp(s1, s2, strlen(s1));
  26.   printf("Difference: %s, %s\n", s1+strlen(s1)-l, s2+strlen(s1)-l);
  27. @}
  28.  
  29. @end example
  30.  
  31.