error: invalid use of array with unspecified bounds
#include<stdio.h>void dayin(int *[],int);
void fanbei(int *[],int);
main()
{
int a[3][5]={1,2,3,4,5,6,m7,8,9,1,2,3,4,5,6};
dayin(a,3);
fanbei(a,3);
dayin(a,3);
}
void dayin(int (*m)[],int n)
{
int i,j;
for(i=0;i<3;i++)
for(j=0;j<5;j++)
printf("%d",*(*(m+i)+j));
}
这段代码的错误,
g++.exe -x c++ -c E:\编程\c文件\rrrr -o E:\编程\c文件\rrrr.o -Wall -fpermissive -Wno-sign-compare -g
E:\编程\c文件\rrrr:5: warning: ISO C++ forbids declaration of `main' with no type
E:\编程\c文件\rrrr: In function `int main()':
E:\编程\c文件\rrrr:6: error: `m7' undeclared (first use this function)
E:\编程\c文件\rrrr:6: error: (Each undeclared identifier is reported only once for each function it appears in.)
E:\编程\c文件\rrrr:7: error: cannot convert `int (*)[5]' to `int**' for argument `1' to `void dayin(int**, int)'
E:\编程\c文件\rrrr:8: error: cannot convert `int (*)[5]' to `int**' for argument `1' to `void fanbei(int**, int)'
E:\编程\c文件\rrrr:9: error: cannot convert `int (*)[5]' to `int**' for argument `1' to `void dayin(int**, int)'
E:\编程\c文件\rrrr: At global scope:
E:\编程\c文件\rrrr:12: error: parameter `m' includes pointer to array of unknown bound `int[]'
E:\编程\c文件\rrrr: In function `void dayin(int (*)[], int)':
E:\编程\c文件\rrrr:16: error: invalid use of array with unspecified bounds
Failure
谢谢了