stringstream函数的用法

1.任意类型转换为string类型

template<class T>
void to_string(string&res,const T&t)
{
    ostringstream oss;
    oss<<t;
    res=oss.str();
}

你可能感兴趣的:(String)