convert a CEGUI::String to a simple char

For help with anything that CEGUI doesn't offer straight out-of-the-box, e.g.:
- Implementation of new features, such as new Core classes, widgets, WindowRenderers, etc. ...
- Modification of any existing features for specific purposes
- Integration of CEGUI in new engines or frameworks and writing of new plugins (Renderer, Parser, ...) or modules

Moderators: CEGUI MVP, CEGUI Team

User avatar
fiammy
Just popping in
Just popping in
Posts: 6
Joined: Tue Nov 15, 2005 13:47
Location: Leuven, Belgium
Contact:

convert a CEGUI::String to a simple char

Postby fiammy » Mon Dec 05, 2005 09:05

Hello,
I'm trying to get a path from a String, which will be read using an Allegro function that accepts only a char. I get this error message :

cannot convert ‘const CEGUI::String’ to ‘const char*’ for argument ‘1’ to ‘BITMAP* load_bitmap(const char*, RGB*)

I admit I have some weakness in all that conversion stuff. What should I do to get the string to convert itself into a char? There is no String.tochar function as far as I know. Might be handy :D

User avatar
martignasse
Just can't stay away
Just can't stay away
Posts: 227
Joined: Thu Apr 14, 2005 08:10
Location: Lyon, FRANCE

Re: convert a CEGUI::String to a simple char

Postby martignasse » Mon Dec 05, 2005 09:18

hi,

the CEGUI::String have a c_str() fonction that should do what you want.

Look at the API Rederence here, API ref is you'r friend ;)

User avatar
fiammy
Just popping in
Just popping in
Posts: 6
Joined: Tue Nov 15, 2005 13:47
Location: Leuven, Belgium
Contact:

Re: convert a CEGUI::String to a simple char

Postby fiammy » Mon Dec 05, 2005 14:46

Thanks,

I really did look at the documentation of the String class, but when you're not sure what you're looking for, it's hard to find ;-).

The compiler is happy, and so am I. Thank you very much.


Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: No registered users and 4 guests