看板 C_Sharp 關於我們 聯絡資訊
如題: 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
TPNEW: {{new KEY_REGION( Keys.NumPad0, Keys.NumPad9)}} 09/07 08:36