strcmpi() function in C
The strcmpi() function is a built-in function in C and is defined in the “string.h” header file. The strcmpi() function is same as that of the strcmp() function but the only difference is that strcmpi() function is not case sensitive and on the other hand strcmp() function is the case sensitive.
int strcmpi (const char * str1, const char * str2 );
- str1: The first string.
- str2: The second string.
Returns: This function returns 0 if the given two strings are same, a negative value if the length of str1 is less then the length of str2 and if the length of str1 is greater then str2 then this function returns a positive value.
Note: This is a non-standard function that works only with older versions of Microsoft C.
Below programs illustrate the strcmpi() function in C:
The function returns = 0
The function returns = 1