c++ 将字符串转换为数字

时间:2019-06-29 10:02:57   收藏:0   阅读:329

 

int string2int(string x);

int string2int(string x){
    int a;
    string res=x;
    stringstream ss;
    ss << res;
    ss >> a;
    return a;
}

 

原文:https://www.cnblogs.com/sea-stream/p/11105403.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!