11.07.2015 Views

PicC 9.50 dsPIC Manual.pdf

PicC 9.50 dsPIC Manual.pdf

PicC 9.50 dsPIC Manual.pdf

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Library FunctionsSTRNCMP, STRNICMPSynopsis#include int strncmp (const char * s1, const char * s2, size_t n)int strnicmp (const char * s1, const char * s2, size_t n)DescriptionThe strcmp() function compares its two, null terminated, string arguments, up to a maximum of ncharacters, and returns a signed integer to indicate whether s1 is less than, equal to or greater than s2.The comparison is done with the standard collating sequence, which is that of the ASCII characterset.The stricmp() function is the case-insensitive version of this function.Example#include #include voidmain (void){int i;}i = strcmp("abcxyz", "abcxyz");if(i == 0)printf("Both strings are equal\n");else if(i > 0)printf("String 2 less than string 1\n");elseprintf("String 2 is greater than string 1\n");See Alsostrlen(), strcmp(), strcpy(), strcat()209

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!