Allegro Strings

This topic is 4147 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

Recommended Posts

I can't use strings with textout_ex();! Excuse my semi-colon, I can't make myself type a C++ function without one... :(... anyway, How can I use/display strings when using allegro. Please help, this problem has been troubling me for monthes! Not having the internet at home sucks...

Share on other sites
There is a member function called c_str() in the string class:

peace.

Share on other sites
I assume you mean std::string.

In this case, you can use the c_str() method from the std::string class which will convert your string to a char array.

std::string t = "Hello World !";textout_ex( the_bmp, the_font, t.c_str(), 10, 10, makecol( 255, 255, 255 ), -1 );

hope that helps !

Thanks!