Format
#include <wchar.h> int __wcsicmp(const wchar_t *string1, const wchar_t *string2);
Language Level: Extension
Threadsafe: Yes.
Description
The __wcsicmp() function compares string1 and string2 without sensitivity to case. All alphabetic wide characters in string1 and string2 are converted to lowercase before comparison. The function operates on null terminated wide character strings. The string arguments to the function are expected to contain a wchar_t null character (L'\0') marking the end of the string.
Return Value
The__wcsicmp() function returns a value indicating the relationship between the two strings as follows:
__wcsicmp() |
Value | Meaning |
Less than 0 | string1 less than string2 |
0 | string1 equivalent to string2 |
Greater than 0 | string1 greater than string2 |
.
Example that uses __wcsicmp()
This example uses __wcsicmp() to compare two wide character strings.
#include <stdio.h> #include <wchar.h> int main(void) { wchar_t *str1 = L"STRING"; wchar_t *str2 = L"string"; int result; result = __wcsicmp(str1, str2); if (result == 0) printf("Strings compared equal.\n"); else if (result < 0) printf("\"%ls\" is less than \"%ls\".\n", str1, str2); else printf("\"%ls\" is greater than \"%ls\".\n", str1, str2); return 0; } /******** The output should be similar to: *************** Strings compared equal. ***********************************/
Related Information
(C) Copyright IBM Corporation 1992, 2006. All Rights Reserved.