其他分享
首页 > 其他分享> > [Error] multidimensional array must have bounds for all dimensions except the first

[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]){

 

标签:初始化,dimensions,creat,int,void,except,bounds,数组,define
来源: https://www.cnblogs.com/Insertt/p/11681372.html