在C ++测试平台中将参数传递给main函数的问题

问题描述 投票:-2回答:1

我正在尝试使用测试平台测试我在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);

当我尝试在测试平台的函数中输入参数时,它向我提供了以下错误消息:

enter image description here

我不知道为什么......

c++ arrays parameters hls test-bench
1个回答
0
投票
void multiplyArray2(int A[][8], int B[][8])

这应该可以解决您的问题。

在C和C ++中,默认情况下不支持多维数组。只有在编译时知道N-dimension时才能传递N-1 dimensions数组。

© www.soinside.com 2019 - 2024. All rights reserved.