#include<stdio.h>
fun(int *p){
int t,*q=p+5;
while(p<q){
t=*p;
*p=*q;
*q=t;
p++;
q--;
}
}
int main(){
int a[]={0,1,2,3,4,5};
fun(a);
for(int i=0;i<6;i++)
printf("%d,",a[i]);
return 0;
}
C language: use pointers to achieve reverse output of arrays
Guess you like
Origin blog.csdn.net/weixin_63987141/article/details/129327957
Recommended
Ranking