c++ int转string

àì夳堔傛蜴生んèń 2022-03-29 07:38 477阅读 0赞

#include “stdafx.h”
#include
#include
#include
using namespace std;
int main()
{
stringstream strStream;
int a = 100;
float f = 23.5566;
strStream << a << “——“<< f ;
string s = strStream.str();
cout << s << endl;
system(“pause”);
return 0;
}

发表评论

表情:
评论列表 (有 0 条评论,477人围观)

还没有评论,来说两句吧...

相关阅读

    相关 JS中Stringint

    方案一代码:   Number(str) 方案二代码:  // parseInt 方法都有两个参数,第一个参数就是要转换的对象,第二个参数是进制基数,可以是2,8