Technical Support
On-Line Manuals
Cx51 User's Guide
#include <string.h> char strcmp ( char *string1, /* first string */ char *string2); /* second string */
The strcmp function compares the contents of string1 and string2 and returns a value indicating their relationship.
The strcmp function returns the following values to indicate the relationship of string1 to string2:
memcmp, strncmp
#include <string.h> #include <stdio.h> /* for printf */ void tst_strcmp (void) { char buf1 [] = "Bill Smith"; char buf2 [] = "Bill Smithy"; char i; i = strcmp (buf1, buf2); if (i < 0) printf ("buf1 < buf2\n"); else if (i > 0) printf ("buf1 > buf2\n"); else printf ("buf1 == buf2\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.