Hi,
I need to grab input from my edit box and set a variable based on that. I have the following in my code:
CEGUI::String ipaddress = ek->window->getText();
I'd like to set ipaddress to either a char* or a char array. How do I accomplish this?
IE: char * ipaddress = ek->window->getText() gives me an error because it's not of type CEGUI::String.
Thanks!
convert CEGUI::String to a char array[] or char*
Moderators: CEGUI MVP, CEGUI Team
- Aussie1497
- Just popping in
- Posts: 1
- Joined: Wed Apr 27, 2005 03:39
Re: convert CEGUI::String to a char array[] or char*
To have the const char * of a String, i think you can use:
const char* String::c_str();
So ek->window->getText().c_str() can be useful to get it
const char* String::c_str();
So ek->window->getText().c_str() can be useful to get it
This method only works for CEGUI::String without accents.
It doesn't work with words containing accents, like "hôtel" in french.
You can see the details here with a small source code to test it : http://www.cegui.org.uk/phpBB2/viewtopic.php?t=1206
Regards,
Pacôme
It doesn't work with words containing accents, like "hôtel" in french.
You can see the details here with a small source code to test it : http://www.cegui.org.uk/phpBB2/viewtopic.php?t=1206
Regards,
Pacôme
Return to “Offtopic Discussion”
Who is online
Users browsing this forum: No registered users and 4 guests