public class student:user
{
public string banji;
public int chinese;
public void Login(user []b,int j)
{
Console.WriteLine("请输人班级:");
b[j].banji = Console.ReadLine();//报错
Console.WriteLine("请输人成绩:");
b[j].chinese = int.Parse(Console.ReadLine());//报错
}
}
} public class user
{
public string name;
public int code;
public void Login(user []a,int i)
{
Console.WriteLine("请输入用户名");
a[i].name = Console.ReadLine();
Console.WriteLine("请输人密码:");
a[i].code = int.Parse(Console.ReadLine());
}
static main()
int i = 0,j=0,k=0;
user[]a = new user[i+1];
student[]b = new student[j+1];
teacher[]c = new teacher[k+1];
Console.WriteLine("1.注册管理者信息2注册学生信息3注册教师信息4查看管理者信息5查看学生信息6查看教师信息");
Console.WriteLine("请选择:");
int contral = int.Parse(Console.ReadLine());
switch (contral)
{
case 1:
{ a[i]=new user();
a[i] . Login( a, i);
i++;
} break;
case 2:
{
b[i] = new student();
Console.WriteLine("请输入用户名");
b[i].name = Console.ReadLine();
Console.WriteLine("请输人密码:");
b[i].code = int.Parse(Console.ReadLine());
Console.WriteLine("请输人班级:");
b[i].banji = Console.ReadLine();
Console.WriteLine("请输人成绩:");
b[i].chinese = int.Parse(Console.ReadLine());
j++;
} break;
为啥有两个报错的地方呀