boost 数据类型转换的方法

#include <boost/lexical_cast.hpp>   


int a = lexical_cast<int>("123");   
string strA = lexical_cast<string>(a);


当然也可以转换 其它的类型. 例如 long  double 等



http://blog.sina.com.cn/s/blog_47145b660100hs7s.html

你可能感兴趣的:(boost 数据类型转换的方法)