只要是声明函数中用了变量,就出错。
比如:
#include <stdio.h>
void hanshu(int n, int m, int shuzu[n][m]); //这个就不能通过
int main(void)
{
int a, b;
int i = 3;
int j = 5;
int shuzu[i][j];
hanshu(i, j, shuzu);
return 0;
}
void hanshu(int n, int m, int shuzu[n][m])
{
int a, b;
for(a = 0; a < n; a++)
for(b = 0; b < m; b++)
scanf("%d", &shuzu[a][b]);
}