C++11 introduced some new conversion functions for that exact purpose:
std::to_string() - Integers and float-types to std::string.
std::stoi() - std::string to int
std::stol() - std::string to long
std::stoul() - std::string to unsigned long
std::stof() - std::string to float
std::stod() - std::string to double
The function-name format is:
s <to> f
string <to> float
Just like the pre-existing atoi() (where 'a' is for ASCII, 'char*' raw-string functions)
This is different from strtof() and the like. I have no clue what those functions do.
([Edit:] Ah, here's an explanation of strtof. I never knew about that function)