簡體   English   中英

C#將int和字節存儲在二維數組中

[英]C# store int and bytes inside two dimensional array

有沒有辦法在二維數組中存儲int和字節?

例如:

int[,] WeaponAddresses = new int[,] { { 0x4F0, 00 00 00 00 00 00 00 00 04 05 01 01 01 01 01 01 } };

我將不勝感激

  1. 您可以使其成為對象數組。
  2. 創建一個具有int和byte屬性的結構,並聲明該結構的一維數組。

     public struct MyObj { public int IntValue {get;set;} public byte[] ByteValue {get;set;} } public class TestClass { MyObj[] arrayOfObjects; } 

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM