SDL_TTF writing ints?

Started by
5 comments, last by nano511 12 years, 8 months ago
How could i get SDL_TTF to write an integer? here is what i want to do..

graphics->ApplyText( 30, 420, player->points, 255, 255, 0, font );


player->points is an int
Advertisement
Use std::stringstream to convert player->points to a string.
std::stringstream ss;
ss << i;
graphics->ApplyText( 30, 420, ss.str().c_str(), 255, 255, 0, font );

Use std::stringstream to convert player->points to a string.
std::stringstream ss;
ss << i;
graphics->ApplyText( 30, 420, ss.str().c_str(), 255, 255, 0, font );



Do i replace 'i' with player->points?
Yes, my mistake. i should be player->points.
It says "incomplete type not aloud" ?
are you including the <sstream> header?
Oh no i included string XD. Thanks

This topic is closed to new replies.

Advertisement