Page 1 of 1

convert a CEGUI::String to a simple char

Posted: Mon Dec 05, 2005 09:05
by fiammy
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

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

Posted: Mon Dec 05, 2005 09:18
by martignasse
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 ;)

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

Posted: Mon Dec 05, 2005 14:46
by fiammy
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.