I want to convert a vertex handle(vit) and double value to string and write it into a file.I thought this works.
string buffer = vit->point() + " " +z_co[vit->id] +"\n";
z_co:is a vector.(double) But,it is throwing error.So,How could I do this?
You can't append a double
to string like that.
Instead use e.g. std::ostringstream
:
std::ostringstream os;
os << vit->point() << " " << z_co[vit->id] << '\n';
std::string buffer = os.str();