C++数字转字符串

时间:2020-07-22 13:54:32   收藏:0   阅读:70
#include <iostream>
#include <cstdio>
#include <sstream>   ///头文件
using namespace std;

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

 

原文:https://www.cnblogs.com/xiaoxb17/p/13359692.html

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