看板 PLT 關於我們 聯絡資訊
: 推 jtmh:這裡的 object 指的是 variable, 在 K&R C 那本常看到這麼用 04/01 00:48 : 推 tinlans:一樓正解,PL 教科書和 C 標準規格書也會這樣用。 04/01 08:35 : 推 caml:c的傳值會生成temp obj?? c++學太多了吧 04/01 09:40 : 推 Lordaeron:這就是問題了, object 以現在的眼光來看, 另有意義了. 04/01 09:59 : 推 tinlans:回三樓,&var 確實會生成一個 temp obj。 04/06 03:37 你到wiki上查一下evaluation strategy 在call by reference條目下﹐ If the argument expression is an L-value, its address is used. Otherwise, a temporary object is constructed by the caller and a reference to this object is passed; the object is then discarded when the function returns. -- -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 211.150.229.195
godfat:這不也是表達 var 是 obj...? 04/11 12:04
caml:我說的意思是c傳值不產生什麼temp obj, 傳個地址還生成obj 04/11 12:17
caml:效率太低了。 04/11 12:21