Do anyone kown how to convert from 'wchar_t' to 'const irr::c8 *'
??
i have a problem like this
\virtualmuseum\modeleventreceiver.cpp(189): error C2440: '=' : cannot convert from 'wchar_t' to 'const irr::c8 *'
THANKS~~
PLS HELP~~!
Urgent Question!!!!!
If you have no problem using the standard libraries (#include <string>) you can do it that way:
You will certainly lose anything which is actually using wchar_t's (for example you will no longer be able to translate it into japanese).
Another thing regarding this post:
Don't *ever* use threadtitles like "Urgent Question!!!!". It makes you look bad. Use a title which tells about the problem (like: How to convert from wchar_t to irr::c8*). And avoid the !!!! and ?? - same reason.
And most importantly: learn using the search button in this forum - i can just bet this question has been asked a lot of times.
Code: Select all
wchar_t * someStringW = L"hello world";
std::wstring wstr( someStringW );
std::string dummy( wstr.begin(), wstr.end() );
const irr::c8 * result = dummy.c_str();
Another thing regarding this post:
Don't *ever* use threadtitles like "Urgent Question!!!!". It makes you look bad. Use a title which tells about the problem (like: How to convert from wchar_t to irr::c8*). And avoid the !!!! and ?? - same reason.
And most importantly: learn using the search button in this forum - i can just bet this question has been asked a lot of times.