I am trying to update a osgText label object.  After about 3000 updates I get a 
std::bad_alloc termination.

I am converting a integer value that usually has only 6 or 7 characters in the 
string and I thought sprintf would be the fastest and easiest way to convert 
from int to std:string.

What is the fastest way to convert from int to str:string?

Any suggestions on how to avoid the segmentation termination? 

Thank you for your help.

cc


void quanthud::setLabel(int id, int val)
{
        quantLabel->setText(itostr(val));
}
std::string quanthud::itostr(int val)
{
    char buff[14];
    return std::string(buff, sprintf(buff, "%d", val));
}

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=43855#43855





_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to