作者james732 (好人超)
看板C_Sharp
標題Re: [問題] C# null
時間Sun Nov 1 23:33:08 2009
※ 引述《light0617 (遺忘的~光)》之銘言:
: for (int i = 1; i < 10; i++)
: {
: bottom.num = list[i];----------->他說問題在這
: bottom.next =null;
: walk = bottom;
: bottom = bottom.next;
: }
1. bottom.next = null;
2. bottom = bottom.next;
導致 bottom 等於 null
解決方法之一
bottom.next = new box();
不過我不確定這是不是你要的結果
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 59.127.184.214
推 light0617:謝謝 不過我真不知道問題出在哪@@ bottom.next=null 11/02 00:36
→ light0617:我後來發現應該是沒問題 11/02 00:37
推 light0617:未處理的例外狀況 System.NullReferenceException:並未 11/02 00:52
→ light0617:將物件參考設定為物件的 11/02 00:53
→ light0617:這段話的意思 11/02 00:53