Re: [問題] C#的一個List和Array的問題

作者: AmosYang (泛用人型編碼器)   2015-01-07 00:05:57
※ 引述《littleshan (我正在想要換什麼)》之銘言:
: ※ 引述《jamod (jasper)》之銘言:
: : 應該是有關記憶體的問題,但上網找了一些說明,還是不是很了解
: 如果你研究過 C++ 的 l-value / r-value / reference
: 再看到這個現象會比較容易理解
: C# 稍微犧牲了一點彈性
: 但加強了記憶體的安全 (不會有 dangling reference)
補充幾個討論串
* http://stackoverflow.com/questions/441309/why-are-mutable-structs-evil
* http://stackoverflow.com/questions/6339602/why-doesnt-c-sharp-support-the-return-of-references
* http://stackoverflow.com/questions/3284767/can-i-use-a-reference-inside-a-c-sharp-function-like-c/
* http://ericlippert.com/2011/06/23/ref-returns-and-ref-locals/
講到 C# 語言實務經驗, Eric Lippert 的 blog 不只是值得一讀
,而且是絕對不能錯過的重要資料
(如果能問出讓 Eric Lippert 亂入來回答的問題,就有如在格鬥
遊戲中滿足了讓豪鬼亂入的條件,是踏入 C#/.NET/CLR 八奇思
考領域的第一步 :D )

Links booklink

Contact Us: admin [ a t ] ucptt.com