Syntax
#include <string.h> int stricmp(const char *string1, const char *string2);Description
stricmp compares string1 and string2 without sensitivity for case. All alphabetic characters in the arguments string1 and string2 are converted to lowercase before the comparison using locale information. stricmp operates on null-terminated strings.
stricmp returns a value that indicates the following relationship between the two strings : compact break=fit.
Value
This example uses stricmp to compare two strings.
#include <stdio.h>#include <string.h> int main(void) { char *str1 = "this is a string"; char *str2 = "THIS IS A STRING"; /* Compare two strings without regard to case */ if (stricmp(str1, str2)) printf("str1 is not the same as str2\n"); else printf("str1 is the same as str2\n"); return 0; /**************************************************************************** The output should be: str1 is the same as str2 ****************************************************************************/ }Related Information