Pointer to the first null-terminated string to compare.
2nd Parameter Type : const char *
Pointer to read-only string
2nd Parameter
Pointer to the second null-terminated string to compare.
Read more about parameters of strcasecmp in parameters section
The strcasecmpfunction in C language Compares two strings ignoring the case of the characters.
The strcasecmp function compares two strings s1 and s2, ignoring the case of the characters. It returns an integer less than, equal to, or greater than zero if s1 is found, respectively, to be less than, to match, or be greater than s2. This function is not part of the C standard library but is available in POSIX systems.
The strcasecmpfunction takes 2
parameters:
•
const char * `s1`: Pointer to the first null-terminated string to compare.
•
const char * `s2`: Pointer to the second null-terminated string to compare.
Compares two strings `s1` and `s2` in a case-insensitive manner. Returns a value less than, equal to, or greater than zero if `s1` is found to be less than, equal to, or greater than `s2`, respectively. Uses the current locale for character case conversion.
The strcasecmp function return value :
Returns an integer less than, equal to, or greater than zero if s1 is found, respectively, to be less than, to match, or be greater than s2
Output
This example demonstrates basic usage of strcasecmp to compare strings ignoring case.