mirror of
https://github.com/janbodnar/Windows-API-examples.git
synced 2024-11-24 11:25:30 +00:00
Create winapi_string_compare.c
This commit is contained in:
parent
2889a0a6aa
commit
67fbdb2b24
30
strings/winapi_string_compare.c
Normal file
30
strings/winapi_string_compare.c
Normal 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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user