Click to See Complete Forum and Search --> : Please Help!!!!


Kelvin
May 28th, 1999, 11:00 PM
How to compare a wide string with a const char* ???
unsigned short* wideString;

wcscmp(wideString, "myName") won't work!!!! even with casting!
Any help is much much appreciated!!!

Yogen M
May 31st, 1999, 12:10 AM
Don't try type-casting!!! All it will do is convince compiler that "myName" is a wide string
which it is not
So convert const char * to wchar * and then use wcscmp.
I don't remember the exact name of the function but I think it starts with mbcs...

Wayne Fuller
May 31st, 1999, 12:19 AM
Have you tried this:
wcscmp(wideString, L"myName");


The 'L' converts the string to a wide string.

Wayne