推 lin79529: 不是我05/06 02:56
噓 buster37: 就是你05/06 03:04
→ tom282f3: 不可能05/06 03:05
推 buster37: 納智捷05/06 03:06
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 120.114.181.124
※ 文章網址: https://www.ptt.cc/bbs/C_and_CPP/M.1556620116.A.F34.html
→ school4303: 35 7000 04/30 20:15
推 ko27tye: c是pointer to pointer 那做兩次dereference會是? 04/30 20:15
→ ko27tye: &操作放在=右邊又是代表? 04/30 20:17
→ mazz: 請問一下**c的含意是甚麼?是指向*c嗎? 04/30 21:08
推 allensheng: 是一個指向指標的指標 名字叫做c 04/30 21:23
推 roytiu: 畫個圖就會比較好了解 名稱(內容)-位址 04/30 21:35
推 Gway: 5000 6000 6000 35 7000 ? 05/01 22:39
→ Gway: 5000 6000 5000 35 7000才對 05/03 20:56
推 arshuan: 去了解一下 複雜變數宣告的判讀方式會比較清楚 google搜 05/04 12:11
→ arshuan: 尋一下understand complicated declaration之類的 05/04 12:11
推 arshuan: b是一個指標指向一個int a的位址 c是一個指標指向一個int 05/04 12:29
→ arshuan: * b的位址 不加任何*或&的狀況下就是印出那個變數本身 05/04 12:29
→ arshuan: 存的data. 加*(dereference)就是把那個data視作address 05/04 12:29
→ arshuan: 去取那個address內的data. **就是取兩次而已 *c是把c 05/04 12:30
→ arshuan: 所存的b位址視為位址然後取該位址的data也就是a的位址。 05/04 12:30
→ arshuan: *(*c)就是再進一步把a的位址視為位址取該位址的data 05/04 12:30
→ arshuan: 也就是35 05/04 12:30
→ rouyu0741: &c = memory address of c = 7000 05/10 13:53
→ rouyu0741: c = &b = memory address of b = 6000 05/10 13:53
→ rouyu0741: *c = *(&b) = b = &a = memory address of a = 5000 05/10 13:53
→ rouyu0741: **c = *(&a) = a = value of a = 35 05/10 13:54
感謝各位大大的協助!
※ 編輯: mazz (218.173.173.62), 05/12/2019 13:36:33