PROGRAMMING:Pointer and array
Please analyze the following code to understand the relationship between pointer and array, pointer operation.
```
#include
int main(){
int a[10]={0,1,2,3,4,5,6,7,8,9};
int i,*p1,*p2,*p3;
p1=a,p2=a+5,p3=a+7; // It is equivalent to P1 = & A [0], P2 = & A [5], P3 = & A [7];
printf("%ld,%ld,%ld\n",p1,p2,p3); // Output pointer value (array element address value)
printf("%d,%d,%d\n",*p1,*p2,*p3); // The output pointer points to the value of the variable
printf("%d,%d\n",p1-p2,p2-p1); // Pointer subtraction
printf("%d,%d\n",p1>p2,p1==a); // The relationship between pointers
for(p1=a; p1printf("%d ",*p1);
return 0;
}
```
Program to read in a number of integers (no more than 50) into the array, and then output in reverse order, traversing the array with a pointer.
###Input example:
```in
1 5 25 18 -299
```
###Output example:
```out
-299 18 25 5 1
```
answer:If there is no answer, please comment
```
#include
int main(){
int a[10]={0,1,2,3,4,5,6,7,8,9};
int i,*p1,*p2,*p3;
p1=a,p2=a+5,p3=a+7; // It is equivalent to P1 = & A [0], P2 = & A [5], P3 = & A [7];
printf("%ld,%ld,%ld\n",p1,p2,p3); // Output pointer value (array element address value)
printf("%d,%d,%d\n",*p1,*p2,*p3); // The output pointer points to the value of the variable
printf("%d,%d\n",p1-p2,p2-p1); // Pointer subtraction
printf("%d,%d\n",p1>p2,p1==a); // The relationship between pointers
for(p1=a; p1printf("%d ",*p1);
return 0;
}
```
Program to read in a number of integers (no more than 50) into the array, and then output in reverse order, traversing the array with a pointer.
###Input example:
```in
1 5 25 18 -299
```
###Output example:
```out
-299 18 25 5 1
```
answer:If there is no answer, please comment