hana12169

1. strstream

可以利用 strstream库函数实现

代码如下:

int n=98989898;

strstream ss;

string s;

ss<<n;

ss>>s;

注:用这种方法需要引入头文件

#include<strstream>

2. sprintf

代码如下:

int n=989898989;

char t[100];

sprintf(t,"%d",n);

string s(t);

 

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2022-02-08
  • 2021-12-03
  • 2021-10-19
  • 2022-12-23
  • 2021-11-07
  • 2022-12-23
  • 2021-09-28
猜你喜欢
  • 2021-10-12
  • 2022-12-23
  • 2022-12-23
  • 2021-07-23
  • 2021-08-18
相关资源
相似解决方案