討論串[問題] 簡單指標釐清
共 3 篇文章
首頁
上一頁
1
下一頁
尾頁
內容預覽:
First of all, you should use %p to print a pointer.. Second, yes, you're printing a, which is a "pointer" and it has been set to 3.It does not mean yo
(還有452個字)
內容預覽:
結果當然是不對. int *a = 3代表你把a設成3. 也就是對電腦來說變數a的rvalue是位址0x3,指向一個int. 當然是錯的. 0x3根本沒東西...你指向一個未初始化的記憶體區塊.... 然後你取a的位址. 所以傳進test的是a的lvalue. 型態是int**. 被compiler
(還有1013個字)
內容預覽:
遇到的問題: 最近主要在研究指標的用法,尤其是在function間傳遞的問題. 希望得到的正確結果: Compiler不要有Warning. 程式跑出來的錯誤結果: [Warning] passing arg 1 of `test' from incompatible. pointer type.
(還有254個字)
首頁
上一頁
1
下一頁
尾頁