C語言:陣列指標總結
阿新 • • 發佈:2018-12-18
#include<stdio.h> //int (*brr)[3] 陣列指標 //int *brr[3] 指標陣列 int main() { int brr[2][3] = {1,2,3,4,5,6}; printf("brr == %d\n",brr); printf("brr+1 ==%d\n",brr+1); printf("*brr+1 == %d\n",*brr+1); printf("*(brr+1) == %d\n",*(brr+1)); printf("*(brr+1)+2===>%d\n",*(brr+1)+2); printf("&brr[1][2]==>%d\n",&brr[1][2]); printf("*(*(brr+1)+2)====%d\n",*(*(brr+1)+2)); printf("*(brr[1]+2)===>%d\n",*(brr[1]+2)); getchar(); return 0; }
答案:brr == 11533740 brr+1 11533752 *brr+1 == 11533744 *(brr+1) == 11533752 *(brr+1)+2=>11533760 &brr[1][2]==>11533760 ((brr+1)+2)==6 *(brr[1]+2)=>6