B
bob
For reasons that are irrelevant , we cannot use sprintf to do
conversions between doubles, ints etc. to char*. We're using the
std:stringstream type. Basically we have a function that takes a
double and needs to store a string representation of it into a vector
of strings. ...
something like this;
void pussy:const double d)
{
std:stringstream strm;
strm << d;
stringbuf *pbuf = strm.rdbuf();
_vect[some_index] = pbuf->str();
}
however this code involves taking a copy of the contents of pbuf string
and I'd like to avoid that. Is there a more efficient way of achieving
my goal without using sprintf etc.
thanks
G
conversions between doubles, ints etc. to char*. We're using the
std:stringstream type. Basically we have a function that takes a
double and needs to store a string representation of it into a vector
of strings. ...
something like this;
void pussy:const double d)
{
std:stringstream strm;
strm << d;
stringbuf *pbuf = strm.rdbuf();
_vect[some_index] = pbuf->str();
}
however this code involves taking a copy of the contents of pbuf string
and I'd like to avoid that. Is there a more efficient way of achieving
my goal without using sprintf etc.
thanks
G