static char daytab[2][13]={
{0,31,28,31,30,31,30,31,31,30,31,30,31},{0,31,29,31,30,31,30,31,31,30,31,30,31}};

```/*求某年某月某日对应的天数为一年中第几天*/
int day_of_year(int year,int month,int day)
{
int i,leap;
leap = (year%4==0 && year%100!=0) || year%400==0;

for(i = 1;i<month;i++)
day += daytab[leap][i];

return day;

}
```

f(int daytab[2][13]){……}

f(int daytab[][13]){……}

```f(int (*daytab)[13]){……}
```

```int *daytab[13]
```

#### 示例1

```#include <stdio.h>
int main(int argc,char** argv)
{
int a[3][3]={{1,2,3},{4,5,6},{7,8,9}};
printf("%d\n",a[2][1]);
printf("%d\n",a[1][4]);
return 0;
}
```

```Array index 4 is past the end of the array (which contains 3 elements)
```

#### 示例2

```#include <stdio.h>
#include <stdlib.h>

void printarry(int **a,int m,int n)
{
for(int i = 0;i < m;i++)
{
for(int j = 0;j < n;j++)
printf("%d ",a[i][j]);
printf("\n");
}
}

int main(int argc,char** argv)
{
int arr[3] ={1,2,3};
int fun[3] ={4,5,6};
int foo[3] ={7,8,9};
int *a[3] = {arr,fun,foo};
/*二维数组指针形式*/
printarry(a,3,3);

printf("%p %p %p\n",&a[0],&a[1],&a[2]);
printf("%p %p %p\n",a[0],a[1],a[2]);
printf("%p %p %p\n",arr,fun,foo);
return 0;
}
```

``````1 2 3
4 5 6
7 8 9
0x7fff5ab30500 0x7fff5ab30508 0x7fff5ab30510
0x7fff5ab30540 0x7fff5ab30530 0x7fff5ab30520
0x7fff5ab30540 0x7fff5ab30530 0x7fff5ab30520``````

#### 变长数组形式参数

int sum_array(int n,int a[n])