注册 登录
编程论坛 C# 论坛

c#中遇到NullReferenceException异常,求大神

麦塞天空 发布于 2015-06-12 20:14, 483 次点击

                student s;
                string x = "11111111";
                    s._number = x;
                s._name = "曾艳";
                s._money = 200;
                s._category = 1;
                users.Add(s._number, s);
提示NullReferenceException异常,
  private Dictionary<string,student> users;     
 private struct student{
            public int _category;
            public string _number;
            public string _name;
            public int _money;
        }

           
2 回复
#2
wp2319572015-06-12 20:21
半拉可及的代码
#3
麦塞天空2015-06-12 20:32
回复 2楼 wp231957
???请问怎么破,很急啊
1