C#中如何定义一个结构体数组,怎么赋值使用
1个回答
展开全部
1.下面是定义一个结构体
struct
HSI
{
public
int
hue;
public
int
saturation;
public
int
intensity;
}
Class
Test2
{
HSI[]
hsi
=
new
HSI[image.width*image.height];
int
hue;
int
saturation;
int
intensity;
hsi[0].hue
=
hue;
hsi[0].saturation
=
saturation;
hsi[0].intensity
=
intensity;
hsi[1].hue
=
hue;
//这样使用结构数组
}
struct
HSI
{
public
int
hue;
public
int
saturation;
public
int
intensity;
}
Class
Test2
{
HSI[]
hsi
=
new
HSI[image.width*image.height];
int
hue;
int
saturation;
int
intensity;
hsi[0].hue
=
hue;
hsi[0].saturation
=
saturation;
hsi[0].intensity
=
intensity;
hsi[1].hue
=
hue;
//这样使用结构数组
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询