[問題] 請問,如何用struct 寫陣列?
如題:
public struct KEY_REGION
{
public Keys Min;
public Keys Max;
public KEY_REGION(Keys Min, Keys Max)
{
this.Min = Min;
this.Max = Max;
}
};
這是我宣告的struct
KEY_REGION[] KeyRegion = new KEY_REGION[2]
{ { Keys.NumPad0, Keys.NumPad9 } , { Keys.D0, Keys.D9 }};
我想要宣告個陣列,去存取初始值,可是會build error,
我不知道C#怎麼用struct去存陣列?
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 1.34.193.134 (臺灣)
※ 文章網址: https://www.ptt.cc/bbs/C_Sharp/M.1599402994.A.ED8.html
推
09/07 08:36,
4年前
, 1F
09/07 08:36, 1F
C_Sharp 近期熱門文章
PTT數位生活區 即時熱門文章