Convert a wchar_t* to char* problem

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
didi

Convert a wchar_t* to char* problem

Post by didi »

for my projet 'Arcis', i make that :

(char*)this->login->getText();

but with this code, i have just the first caracter of the line login->getText() !
why ?
Nuelle
Posts: 3
Joined: Sun Jun 27, 2004 11:20 pm

Post by Nuelle »

a string is an array of multiple characters

you only get the first character if you try it like you did.

if you like to convert these strings you have to do this several times for every letter.

string->size()

delivers you the length of the string

with the help of a for instruction like
for(i=0;i<size;i++)
{
string1 = string2;
}
it should work.
Post Reply