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

Popular posts from this blog

google chrome - Developer tools - How to inspect the elements which are added momentarily (by JQuery)? -

angularjs - Showing an empty as first option in select tag -

php - Cloud9 cloud IDE and CakePHP -