首页 > 其他 > 详细

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

时间:2019-10-15 22:11:11      阅读:232      评论:0      收藏:0      [点我收藏+]

错误笔记 

程序示例

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

 

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

原文:https://www.cnblogs.com/Insertt/p/11681372.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!