[問題] 請教一題pointer的問題

作者: mazz (好好把握眼前的幸福)   2019-04-30 18:28:28
開發平台(Platform): (Ex: Win10, Linux, ...)
編譯器(Ex: GCC, clang, VC++...)+目標環境(跟開發平台不同的話需列出)
額外使用到的函數庫(Library Used): (Ex: OpenGL, ...)
問題(Question):
這是寫紙本考卷上的題目,所以上面那幾項不知道要寫什麼orz
如果有發文問題還請不吝指正
題目:假設a,b,c三變數分別存放在記憶體位置5000,6000,7000
1.int a = 35;
2.int *b = &a;
3.int **c = &b;
試求b , c , *c , **c , &c
餵入的資料(Input):
預期的正確結果(Expected Output):
錯誤結果(Wrong Output):
程式碼(Code):(請善用置底文網頁, 記得排版,禁止使用圖檔)
補充說明(Supplement):
**c 和 &c 搞不清楚到底要怎麼看
如果這樣發文格式有誤還有請各位提出,謝謝
作者: school4303 (某爬蟲類)   2019-04-30 20:15:00
35 7000
作者: ko27tye (好滋好滋)   2019-04-30 20:15:00
c是pointer to pointer 那做兩次dereference會是?&操作放在=右邊又是代表?
作者: mazz (好好把握眼前的幸福)   2019-04-30 21:08:00
請問一下**c的含意是甚麼?是指向*c嗎?
作者: allensheng (上將帽子)   2019-04-30 21:23:00
是一個指向指標的指標 名字叫做c
作者: roytiu (恨長風)   2019-04-30 21:35:00
畫個圖就會比較好了解 名稱(內容)-位址
作者: lin79529 (lin.heros)   2019-05-06 02:56:00
不是我
作者: buster37 (Dean)   2019-05-06 03:04:00
就是你
作者: tom282f3 (學妹戰士)   2019-05-06 03:05:00
不可能
作者: buster37 (Dean)   2019-05-06 03:06:00
納智捷
作者: Gway (我愛的你 也愛我 好嗎?)   2019-05-01 22:39:00
5000 6000 6000 35 7000 ?
作者: arshuan (阿軒)   2019-05-04 12:11:00
去了解一下 複雜變數宣告的判讀方式會比較清楚 google搜尋一下understand complicated declaration之類的
作者: rouyu0741 (塊陶阿!! >ω<")   2019-05-10 13:53:00
&c = memory address of c = 7000c = &b = memory address of b = 6000*c = *(&b) = b = &a = memory address of a = 5000**c = *(&a) = a = value of a = 35

Links booklink

Contact Us: admin [ a t ] ucptt.com