Page 1 of 1

How can i convert 'const wchar_t' to 'const char *'

Posted: Sat Dec 22, 2007 12:16 am
by patrickniceboy
xml->getNodeName(), it returns const wchar_t how can i convert it to const char * ???

but why?
look:

Code: Select all

 
 if(!strcmp("node", xml->getNodeName())

strcmp declaration

Code: Select all

strcmp(const char * _Str1, const char * _Str2);

Posted: Sat Dec 22, 2007 1:52 am
by shogun
You should have a look at the board search, it has already been discussed.

Google for wcstombs and/or wcscmp.

Or try the following:

Code: Select all

if (irr::core::stringw(xml->getNodeName()) != L"node")