討論串[問題] C#的一個List和Array的問題
共 3 篇文章
首頁
上一頁
1
下一頁
尾頁

推噓0(0推 0噓 1→)留言1則,0人參與, 最新作者AmosYang (泛用人型編碼器)時間10年前 (2015/01/07 00:06), 編輯資訊
0
0
5
內容預覽:
補充幾個討論串. * http://stackoverflow.com/questions/441309/why-are-mutable-structs-evil. * http://stackoverflow.com/questions/6339602/why-doesnt-c-sharp-sup
(還有318個字)

推噓2(2推 0噓 0→)留言2則,0人參與, 最新作者littleshan (我正在想要換什麼)時間10年前 (2015/01/06 15:56), 編輯資訊
0
0
1
內容預覽:
因為 list[0] 實際上是呼叫 List class 的 indexer get method. 它是個 function call 會回傳整個 struct 的複本 (因為 C# 無法回傳 ref). 當你對複本修改內容,對原本存在 List 中的 struct 毫無效果. 既然無效果,com
(還有475個字)

推噓0(0推 0噓 7→)留言7則,0人參與, 最新作者jamod (jasper)時間10年前 (2015/01/06 15:15), 10年前編輯資訊
0
0
1
內容預覽:
應該是有關記憶體的問題,但上網找了一些說明,還是不是很了解. =============================================. public struct s_Test{. public int i;. }. 上面是我自訂的一個struct. ==============
(還有637個字)
首頁
上一頁
1
下一頁
尾頁