Create winapi_string_compare.c

This commit is contained in:
Jan Bodnar 2016-04-07 15:41:45 +02:00
parent 2889a0a6aa
commit 67fbdb2b24

View File

@ -0,0 +1,30 @@
#include <windows.h>
#include <wchar.h>
#define STR_EQUAL 0
int wmain(void) {
wchar_t *s1 = L"Strong";
wchar_t *s2 = L"strong";
if (lstrcmpW(s1, s2) == STR_EQUAL) {
wprintf(L"%ls and %ls are equal\n", s1, s2);
} else {
wprintf(L"%ls and %ls are not equal\n", s1, s2);
}
wprintf(L"When applying case insensitive comparison:\n");
if (lstrcmpiW(s1, s2) == STR_EQUAL) {
wprintf(L"%ls and %ls are equal\n", s1, s2);
} else {
wprintf(L"%ls and %ls are not equal\n", s1, s2);
}
return 0;
}