c++11中提供了to_string函数,定义在string中,
重载了一大片,
std::string to_string( int value ); (1) (since C++11) std::string to_string( long value ); (2) (since C++11) std::string to_string( long long value ); (3) (since C++11) std::string to_string( unsigned value ); (4) (since C++11) std::string to_string( unsigned long value ); (5) (since C++11) std::string to_string( unsigned long long value ); (6) (since C++11) std::string to_string( float value ); (7) (since C++11) std::string to_string( double value ); (8) (since C++11) std::string to_string( long double value );
另外,标准库中string有一批函数,特别难用.