Function name : strictmp
Header file : <string.h>
Function prototype : int strictmp(const char *str1, const char *str2);
Function : Compare the size of two strings, but not case sensitive
Parameters : str1 and str2 are the two strings to be compared.
Return value : str1>str2 returns 1;
str1==str2 returns 0;
str1<str2 returns -1;
Program example: Compare the sizes of string buf1 and string buf2 and output the result
#include<string.h>#include<stdio.h>intmain(void){char*buf1=WWW.DOTCPP.COM,*buf2=www.dotcpp.com;intptr=stricmp(buf2,buf1);if(ptr >0){printf(buffer2isgreaterthanbuffer1n);}if(ptr<0){printf(buffer2islessthanbuffer1n);}if(ptr==0){printf(buffer2equalsbuffer1n);}return0;}
Running results:
buffer2equalsbuffer1