我想一个double*
转换为string
在C++:转换双*到std :: string的在C++
#include <iostream>
#include <string>
using namespace std;
int main()
{
int i;
double *f = new double[5];
for(i = 0; i < 5; i++)
{
f[i] = 5;
}
string f_str;
//this is for double to string
//f_str = std::to_string(f);
//i want for double*
cout << f_str << '\n';
delete [] f;
return 1;
}
你要输出的地址值? – 2014-09-26 11:30:18
预期产量是多少? – Csq 2014-09-26 11:32:27
为什么你从程序中返回1? – Csq 2014-09-26 11:32:45