double转字符串输出:
#include <windows.h>
char outStr2[1000];//
sprintf(outStr2, "%lf \n", dst[width * (y + y_padding) + x + x_padding]);//将double转字符串;
OutputDebugString(outStr2);
------------------------------------------------
全局变量必须用.h和.cpp
.h
extern int outSize;
.cpp
int outSize=0;
本文介绍了一个使用C++实现double类型数据转换为字符串的例子,通过sprintf函数完成转换,并利用OutputDebugString输出。此外,还展示了全局变量的正确声明与定义方式。
26万+

被折叠的 条评论
为什么被折叠?



