Technical Support
On-Line Manuals
Cx51 User's Guide
#include <string.h> char memcmp ( void *buf1, /* first buffer */ void *buf2, /* second buffer */ int len); /* bytes to compare */
The memcmp function compares the first len bytes from buf1 and buf2 and returns a value indicating their relationship as follows:
The memcmp function returns a positive, negative, or zero value indicating the relationship of buf1 and buf2.
memccpy, memchr, memcpy, memmove, memset
#include <string.h> #include <stdio.h> /* for printf */ void tst_memcmp (void) { char hexchars [] = "0123456789ABCDEF"; char hexchars2 [] = "0123456789abcdef"; char i; i = memcmp (hexchars, hexchars2, 16); if (i < 0) printf ("hexchars < hexchars2\n"); else if (i > 0) printf ("hexchars > hexchars2\n"); else printf ("hexchars == hexchars2\n"); }
Cookie Settings | Terms of Use | Privacy | Accessibility | Trademarks | Contact Us | Feedback
Copyright © 2005-2019 Arm Limited (or its affiliates). All rights reserved.
This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.
Change Settings
Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers of your data.