class xx{public static struct date{string mname;string mpass;}class memory{public static date[] creatmemory(){date[] mymemory =new date[10];return mymemory;}public static void writememory(date[] m,string na,string pa){ m.mname = na;m.mpass = pa;}}提示不包含定义,或using引用
2 回答
jeck猫
TA贡献1909条经验 获得超7个赞
m 是date[] 下面这么调用出问题了
m.mname = na;
m.mpass = pa;
修改成下面的
class xx
{
public struct date
{
public string mname;
public string mpass;
}
class memory
{
public static date[] creatmemory()
{
date[] mymemory = new date[10];
return mymemory;
}
public static void writememory(date[] m, string na, string pa)
{
for (var i = 0; i < m.Length; i++)
{
m[i].mname = na;
m[i].mpass = pa;
}
}
}
}
- 2 回答
- 0 关注
- 1020 浏览
添加回答
举报
0/150
提交
取消