[Error] multidimensional array must have bounds for all dimensions except the first

错误笔记 

程序示例

#define N 10
int a [N][N] ;
//写一个creat函数,初始化数组
void creat(int [][]){

}

程序编译后出现题示错误 因为多维数组作为形参传入时,必须声明除第一位维外的确定值,否则系统无法编译(算不出偏移地址)

改进代码:

#define N 9
int a [N][N] ;
int(*p)[N]=a;
//写一个creat函数,初始化数组
void creat(int(*p)[N]){

 

posted @ 2019-10-15 21:57  Insertt  阅读(4517)  评论(0)    收藏  举报