Convert double and vertex handle into a string in c++ -
i want convert vertex handle(vit) , double value string , write file.i thought works.
string buffer = vit->point() + " " +z_co[vit->id] +"\n";
z_co:is vector.(double) but,it throwing error.so,how this?
you can't append double
string that.
instead use e.g. std::ostringstream
:
std::ostringstream os; os << vit->point() << " " << z_co[vit->id] << '\n'; std::string buffer = os.str();
Comments
Post a Comment