comparing wchar_t ???

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Acki

comparing wchar_t ???

Post by Acki »

Hi,
I have a problem that's a little bit off topic... ;)

How do you compare two wchar_t strings ???

I tried it like this:

if(strcmp((char*)wString1, (char*)wString2) == 0){

}

But it compares only the first letters of the strings !!!
Is the a special function for this, like swprintf() for printf() ???

Cu, Acki
R00mpel
Posts: 41
Joined: Sun Nov 09, 2003 10:12 am
Location: Russia, Nizhny Novgorod

Post by R00mpel »

Yes, there is.

Code: Select all

int wcscmp(
   const wchar_t *string1,
   const wchar_t *string2 
);
The only thing to fear is running out of beer!
Acki

Post by Acki »

Oh, thanks! ;)
I think it's a little bit confusioning:
swprintf() <-> wcscmp()
Why they can't make the functions equal like:
swprintf() <-> swcmp()
or
wcsprintf() <-> wcscmp()

????????

Well, it's no fault of Irrlicht....

thx, Acki
Post Reply