當前位置:成語大全網 - 新華字典 - c#字典中傳入結構體和類在賦值時候的區別

c#字典中傳入結構體和類在賦值時候的區別

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;

//這樣使用結構數組

}