/* CS201 Functions for converting numbers to strings and vice versa using string-streams Programmer: RJB */ #ifndef STRINGNUMBERSH #define STRINGNUMBERSH #include #include // strings you can treat as input and output using namespace std; string convertDouble(double d) { std::ostringstream s; s << d; return s.str(); } double convertToDouble(string d) { double result; std::istringstream s(d); s >> result; return result; } #endif