c++怎样把double转为string

参考:

https://jingyan.baidu.com/article/3f16e003d076602590c10370.html

Windows系统下:

string buffer;
char r[256];
string s; 
sprintf(r,"%.4f",totalTime/60);    //4 为小数位数
s = r;
buffer1 = buffer+ "总时长: " + s + "min" +'\t';


你可能感兴趣的:(c++怎样把double转为string)