编程语言
首页 > 编程语言> > C++ string和数字间的任意转换

C++ string和数字间的任意转换

作者:互联网

 

#include <sstream>

template <class SRC, class DST>
void Str22Num(SRC& src, DST& dst)
{
    std::stringstream in;
    in << src;
    std::stringstream out(in.str());
    out >> dst;
}

 

参考:https://blog.csdn.net/Vic___/article/details/9324897

标签:9324897,string,dst,C++,blog,csdn,template,stringstream,任意
来源: https://www.cnblogs.com/linxisuo/p/15693548.html