Hi!
How can i cast the wchar_t string, i got with IGUIEditBox::getText() cast into an int?
How to get an int out of wchar_t
-
Peter Müller
- Posts: 292
- Joined: Sun Mar 14, 2004 5:28 pm
- Location: Germany
- Contact:
How to get an int out of wchar_t
http://www.games-forge.de - Die Community für Nachwuchsprogrammierer
-
Serg Nechaeff
- Posts: 162
- Joined: Wed Nov 26, 2003 5:24 pm
- Location: Europe
Re: How to get an int out of wchar_t
Hey, Peter! it's as simple as that:Peter Müller wrote:Hi!
How can i cast the wchar_t string, i got with IGUIEditBox::getText() cast into an int?
stringc _str = yourbox->getText();
int value = atoi (_str.c_str());
http://www.javazing.com
P-III-950, WinXP, GeForce FX5600 128 MB ForceWare 52.16, DX9, Eclipse IDE, JRE 1.6
P-III-950, WinXP, GeForce FX5600 128 MB ForceWare 52.16, DX9, Eclipse IDE, JRE 1.6
-
Peter Müller
- Posts: 292
- Joined: Sun Mar 14, 2004 5:28 pm
- Location: Germany
- Contact:
Thanks. Found something else:
int i = _wtoi(yourbox->getText());
wtoi stands for wchar to int and atoi for ascii to int, right?
int i = _wtoi(yourbox->getText());
wtoi stands for wchar to int and atoi for ascii to int, right?
http://www.games-forge.de - Die Community für Nachwuchsprogrammierer
-
Serg Nechaeff
- Posts: 162
- Joined: Wed Nov 26, 2003 5:24 pm
- Location: Europe
absolutely! and it's even simpler
http://www.javazing.com
P-III-950, WinXP, GeForce FX5600 128 MB ForceWare 52.16, DX9, Eclipse IDE, JRE 1.6
P-III-950, WinXP, GeForce FX5600 128 MB ForceWare 52.16, DX9, Eclipse IDE, JRE 1.6