我正在尝试使用测试台测试我在C ++中创建的功能。主要功能参数是两个8x8数组:
void multiplyArray2(int A[8][8], int B[8][8]){
在测试台文件中,我创建了一个值的输入数组和一个输出数组,并试图将它们输入到函数中:
int dataIn[8][8];
int dataOut[8][8];
int main(){
dataIn = {{68, 68, 67, 67, 66, 67, 67, 67},
{69, 69, 68, 68, 67, 69, 67, 67},
{70, 70, 71, 71, 70, 70, 70, 70},
{72, 72, 72, 71, 72, 72, 72, 71},
{74, 74, 73, 73, 74, 74, 74, 74},
{75, 76, 75, 75, 76, 76, 75, 75},
{76, 77, 77, 76, 76, 76, 76, 76},
{79, 78, 79, 79, 78, 76, 77, 77}};
multiplyArray2(dataIn, dataOut);
当我尝试在测试台中的函数中输入参数时,它向我提供了以下错误消息:
我不知道为什么...
答案 0 :(得分:0)
void multiplyArray2(int A[][8], int B[][8])
这应该可以解决您的问题。
在C和C ++中,默认情况下对多维数组的支持不是很好。只有在编译时知道N-dimension
时,才能传递N-1 dimensions
数组。