1 #include<stdio.h> 2 3 int main() 4 { 5 int arr[]={1,5,6,3,85,62,20,98}; 6 int len=sizeof(arr)/sizeof(arr[2]); 7 int i,*p=arr; 8 /*for (i=0;i<len;i ++) { 9 printf("%d ",*(arr+i)); 10 }*/ 11 printf("%p %X ",&arr,p); 12 for (i=0;i<len;i++){ 13 printf("%d ",*p++);//借助自增运算符来遍历数组元素 14 printf("%X ",p); 15 } 16 /*printf("%p %X ",&arr,p);*/ 17 18 char b[]="hello"; 19 printf("%s ",b); 20 len=sizeof(b)/sizeof(b[6]); 21 for (int n=0;n<len;n++) { 22 printf("%c ",b[n]); 23 printf("%c ",*(b+n)); 24 } 25 return 0; 26 }