基本上,我要做的是将数组作为参数传递。我想到了这样的想法:
#include <stdio.h>
#include <stdlib.h>
int x;
void function(int array[][x]){
//stuff here
}
int main(){
x = random(10);
int array[10][x];
//initialize array
function(array[10][x]);
}
我认为这应该可行,但它给了我一个注释:
expected ‘int (*)[(unsigned int)(x)]’ but argument is of type ‘int’
如有任何帮助,我们将不胜感激。
最佳答案
关于c - 将多维数组作为参数传递给c,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13745375/