Ho provato anche con osstringstream in questo modo:
string conv_to_str(const float& number)
{
ostringstream oss;
oss << number;
return oss.str();
}
main(){
string stringa;
float x = 32.25678
stringa = "numero " + conv_to_str(x) + "\n";
out << stringa;
Così funziona , solo che non mi mantiene la formattazione propria del tipo float -> Mi arrotonda a 32.257, e questo, per quello che a me serve , non va bene.
Grazie