# include <stdio.h>
void arrPrint(int *arr,int n){
for (int i=0; i<n; i++) {
printf("a[%d]=%d\n",i,*(arr++));
}
printf("数组打印完成\n");
}
int main (){
int arr[]={1,4,6,3,8,5,7,8};
int m=sizeof(arr)/sizeof(int);
for (int i=0; i<m; i++) {
printf("arr[%d]=%d\n",i,arr[i]);
}
printf("数组打印完成\n");
arrPrint(arr,m);
return 0;
}
|
|