作者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
1F:推 light0617:谢谢 不过我真不知道问题出在哪@@ bottom.next=null 11/02 00:36
2F:→ light0617:我後来发现应该是没问题 11/02 00:37
3F:推 light0617:未处理的例外状况 System.NullReferenceException:并未 11/02 00:52
4F:→ light0617:将物件参考设定为物件的 11/02 00:53
5F:→ light0617:这段话的意思 11/02 00:53