衝啊!pointer!
今日主題:指標與二維陣列(續)
接續昨天的議題,今天來看個範例。
#include <stdio.h>
main()
{
int arr[3][2] = {100,200,300,400,500,600};
int i;
for (i = 0; i < 3; i++){
printf("arr[%d] = %p\n", i, arr[i]);
printf("arr+%d = %p\n", i, arr+i);
printf("*(arr%d) = %p\n\n", i, *(arr+i));
}
}
結果如下:
arr[0] = 0x7fff43520df0
arr+0 = 0x7fff43520df0
*(arr0) = 0x7fff43520df0
arr[1] = 0x7fff43520df8
arr+1 = 0x7fff43520df8
*(arr1) = 0x7fff43520df8
arr[2] = 0x7fff43520e00
arr+2 = 0x7fff43520e00
*(arr2) = 0x7fff43520e00
昨天問的問題,竟然今天才有答案...
裝作沒看到...
竟然跑去雜誌做專訪,不來回答問題....
趕快把記者辣妹的照片貼出來就不怪你了...
我碰到的是拓也哥類型的...
那你是被....