C++——整型数字与字符串相互转换

转载自:https://blog.csdn.net/liangzhao_jay/article/details/87872493

C++11提供了 to_string 、stoxxx方法, 示例代码如下:

#include 
#include 
 
using namespace std;
 
//数字转字符串
void numberTostr()
{
    string strInt = std::to_string(100);
    cout<<"strInt = "<

你可能感兴趣的:(C++)