我正在尝试将以下数据导出为Excel,但它在range_dataFloat
下的最后一行显示错误。这是我得到的错误:
Excel :: RangePtr - Expression必须是指向完整对象类型的指针
其余代码正在运行并连接到excel,但问题出在这一部分:
int SW1 [2] = { 0, 0 }; // South-West coordinate of the first square
int SE1 [2] = { 1, 0 }; // South-East coordinate of the first square
int NW1 [2] = { 0, 1 }; // North-West coordinate of the first square
int NE1 [2] = { 1, 1 }; // North-East coordinate of the first square
Excel::RangePtr range_dataFloat;
range_dataFloat = sheet_input -> GetRange (L"Coordinates");
int Square_Coordinates [i][j];
for ( i = 0 ; i < n_squares ; i++ ) // For loop to move to the next row
{
int p = 1;
// Changing the coordinates of the first square in each row
SW1 [1] = i;
SE1 [1] = i;
NW1 [1] = i+1;
NE1 [1] = i+1;
range_dataFloat -> Item [p][p] = SW1[0];