sdl - TTF_RenderText with integer -


is posible use ttf_render_textsolid controlled 1 integer? try use stringstreams this:

stringstream  _minutes; stringstream  _seconds; stringstream  _miliseconds;  _minutes << minutes << ":"; _seconds << seconds << ":"; _miliseconds << miliseconds; 

(the variable minutes, seconds , miliseconds scoped)

but when compile this, compile then, run , says : core dumped. error in memory part. mmh happens?

doing along lines of:

stringstream ss; ss << minutes << ":" << seconds << ":" << miliseconds; const string str = ss.str(); sdl_surface* surf = ttf_rendertext_solid(textfont, str.c_str(), textcolor); 

should work without problem.

do not store const char* comes out of though! str goes out of scope, const char* won't valid anymore.


Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -