#include <stdio.h>
int main(){
char arr[]={'a','b','c','d'};
char *c = &arr[0];
printf("%c\n",c[0+1]);
printf("%c\n",c[1]);
printf("%c\n",arr[1+0]);
printf("%c\n",c[0+2]);
printf("%c\n",c[2]);
printf("%c\n",arr[2+0]);
printf("--------------\n");
char *c1 = &arr[1];
printf("%c\n",c1[0+1]);
printf("%c\n",c1[1]);
printf("%c\n",arr[1+1]);
printf("%c\n",c1[0+2]);
printf("%c\n",c1[2]);
printf("%c\n",arr[2+1]);
return 0;
}
printf("%c\n",c[2]);这行代码 和 printf("%c\n",arr[2+1]);这行代码 怎么打印结果是一样的哦 ????? |
|