[問題] address operator &
網址:
https://stackoverflow.com/questions/49890211/address-operator-and-array-in-assembly-level
在Answer裡面提到:
The address of & operator allows you to construct a pointer to value from a
variable of same type as value.
中文翻譯:address operator允許你建構一個指標(from一個變數to value,且這個變數有
跟value一樣的type)
請問,這一行的意思是不是指,當執行程式這一行時:
p = &var1;
&本身也會占用一個variable的空間(用來放var1的address),然後在把這個address給p?
接下來,內文提到:
int *p = &A;
程式在做這行指令時,you are doing an assignment from a pointer to array of int
into a variable of type array of int, which is a different type.
光看這行英文,哪有different type,一樣是array of int啊
還是他打錯了?應該是from a pointer to int into a variable of type array of int?
謝謝。
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 60.248.26.157
※ 文章網址: https://www.ptt.cc/bbs/C_and_CPP/M.1524388743.A.75B.html
→
04/22 18:48,
7年前
, 1F
04/22 18:48, 1F
→
04/22 19:04,
7年前
, 2F
04/22 19:04, 2F
→
04/22 19:05,
7年前
, 3F
04/22 19:05, 3F
→
04/23 14:53,
7年前
, 4F
04/23 14:53, 4F
討論串 (同標題文章)
完整討論串 (本文為第 1 之 2 篇):