user2452165
user2452165

Reputation: 219

C# store int and bytes inside two dimensional array

Is there a way, to store a int and bytes inside a 2 dimensional array?

For example:

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

I would appreciate any kind of help

Upvotes: 1

Views: 65

Answers (1)

Muckeypuck
Muckeypuck

Reputation: 559

  1. You could make it an array of objects.
  2. create a structure with an int and byte property and declare a 1 dimensional array of the structure.

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

Upvotes: 2

Related Questions