Hi guys
Damn .. I'm banging my head against the wall right now - cuz´ I just cant figure out how to convert the Gui´s editboxes wchar_t values - into something usefull. Damn you wchar_t´s
Could someone please post a code snippet for converting the editbox content to a char* and an int. The code need to work with mingw (win32) and gcc (Linux).
Regards Stickybit
wchar_t conversion (aka: arghhh ... bloody wchar_t´s)
This question has been asked a million time, and a quick search give you an answer, this one for example :
http://irrlicht.sourceforge.net/phpBB2/ ... conversion
http://irrlicht.sourceforge.net/phpBB2/ ... conversion
I do it the easy way, like this
I'm surprised that a lot of people have missed the simple and handy function atoi. Guess what it does? It takes an ascii-string and returns an integer
Code: Select all
wchar_t* SomePointer;
stringc Temp(SomePointer);
char *AnotherPointer=Temp.c_str();
//Or the other way around
char* SomePointer;
stringw Temp(SomePointer);
wchar_t *AnotherPointer=Temp.c_str();
Code: Select all
char *SomeString;
int MyInt=atoi(SomeString);
If you don't have anything nice to say, don't say anything at all.