C++数字转字符串

#include <iostream>
#include <cstdio>
#include <sstream>   ///头文件
using namespace std;

int main()
{
    ostringstream s;
    s << 100 << 12.2;
    cout << s.str();  ///输出 10012.2
    return 0;
}

 

posted @ 2020-07-22 11:34  xiongbing  阅读(170)  评论(0)    收藏  举报