Here's a short function that will do it: string dtos(double d) { strstream s; s << d; return s.str(); }