Jump to content
  • Advertisement
Sign in to follow this  
Possumdude0

Allegro Strings

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

If you intended to correct an error in the post then please contact us.

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 this post


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

string crackhead= "crackhead";

textout( blah, blah, crackhead.c_str(),);

peace.

Share this post


Link to post
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 !

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!