{{1.1,true} {1.2,false} {1.3,true}}
{{2.1,true} {2.2,false} {2.3,false}}
我定义了一个结构体: private struct SpaDisLisN
{
public float SpaDisN;
public bool SpaDisBoo;
}
我希望这个结构体是一个二维数组的形式存储的,
我实例化的时候: SpaDisLisN s12[10,10];
出现错误!
3 个解决方案
#1
SpaDisLisN[,] s12 = new SpaDisLisN[10,10];
#2
学习
#3
private struct SpaDisLisN
{
public float SpaDisN;
public bool SpaDisBoo;
}
private SpaDisLisN[,] s22;
{
public float SpaDisN;
public bool SpaDisBoo;
}
private SpaDisLisN[,] s22;
#1
SpaDisLisN[,] s12 = new SpaDisLisN[10,10];
#2
学习
#3
private struct SpaDisLisN
{
public float SpaDisN;
public bool SpaDisBoo;
}
private SpaDisLisN[,] s22;
{
public float SpaDisN;
public bool SpaDisBoo;
}
private SpaDisLisN[,] s22;