13.10 Write a function in C called my2DAlloc which allocates a two-dimensional array. Minimize the number of calls to malloc and make sure that the memory is accessible by the notation arr[i][j]. 这道题让我们写个C语言函数my2DAlloc用来给一个二维数组分配内存,并且让我们尽可能的少调用malloc
数组(Array):相同类型数据的集合就叫做数组. (一)定义数组的方法: A) type[] 变量名 = new type[数组中元素的个数] 例如: int[] a = new int[10] ; 或者 int a[] = new int[10]; B)type[] 变量名 = new type[]{逗号分隔的初始化列表} 例如:int[] a = new int[]{1,2,3,4} (二)数组的length属性 每个数组都有一个length属性,表示数组的长度,length属性是p