有这样的代码(片):
int count = data.getCount();
const XYZ* pData = data.getData();
this->CreateGrid(count, 3);
this->SetColLabelValue(0, "x"); // тут ругается
this->SetColLabelValue(1, "y");
this->SetColLabelValue(2, "z");
for (int i = 0; i < count; i++)
{
wxString str = "";
str << pData[i].x; this->SetCellValue(i, 0, str); str = ""; // тут тоже ругается
str << pData[i].y; this->SetCellValue(i, 1, str); str = "";
str << pData[i].z; this->SetCellValue(i, 2, str); str = "";
}
我做错了什么?
问题似乎是您正在使用 Unicode 编译程序,在这种情况下,类型为 elements 的字符串没有隐式构造函数
char。所以尝试使用宽字符串,即元素类型
wchar_t。例如,