string转数值:
template <class T>
T stringToNumT(const string& str){
istringstream iss(str);
T num;
iss >> num;
return num;
}
其他:
更多见:(https://www.cnblogs.com/ZY-Dream/p/9960637.html)
字符转string
1.
string charToString(char c)
{
stringstream stream;
stream<<c;
return stream.str();
}
2.
string(1,c)