-->
当前位置:首页 > 题库

PROGRAMMING:Pointer and two dimensional array

Luz5年前 (2021-05-10)题库356
Analyze the following code to understand the pointer and two-dimensional array
```
#include
int main(){
int a[3][4]={1,2,3,4,5,6,7,8,9,10,11,12};
int i,j;
for(i=0; i<3; i++)
for(j=0; j<4; j++)
printf("%d.",*(*(a+i)+j));
printf("\n");
int(*p)[4]; // Defines a pointer variable p that points to a row of (4 int) variables
p=a;
for(i=0; i<3; i++){
for(j=0; j<4; j++)
printf("%d.",*(*(p+i)+j));
}
return 0;
}
```
###Input example:
```in
```
###Output example:
```out
1.2.3.4.5.6.7.8.9.10.11.12.
1.2.3.4.5.6.7.8.9.10.11.12.
```







answer:If there is no answer, please comment