dineshK
dineshK

Reputation: 1

compare two wide character strings visual c++

I need to compare two wide character strings in c++.

wchar_t *str1 = L"abc";
wchar_t *str2 = L"abc";

How to compare two wchar_t* variables?

Upvotes: 0

Views: 1403

Answers (1)

Deadlock
Deadlock

Reputation: 4529

use wcscmp() to compare wide character strings.

wchar_t *str1 = L"abc";
wchar_t *str2 = L"abc";

if (wcscmp(str1,str2) == 0)
    cout << "str1 and str2 are Equal";

Upvotes: 4

Related Questions