我正在尝试将2D数组传递给函数,以下是我的代码。
float solve(float arr[(nsamples*numImages)+255][256 + nsamples]){
return 0;
}
int main(){
nsamples = 100;
numImages = 5;
float arr[ (nsamples*numImages)+255][256 + nsamples];
float res = solve(arr);
return 0;
}
nsamples和numImages是全局变量。我收到以下错误
candidate function not viable: no known conversion from
'float [(nsamples * numImages) + 255][256 + nsamples]' to 'float (*)[256 +
nsamples]' for 1st argument
int solve(float arr[(nsamples*numImages)+255][256 + nsamples]){
我尝试了here给出的变化,但没有任何效果。