0

I have a jagged uint8 array like this in c++:

UINT8 ras[2][3] = {{1,2,3},{4,5,6}}

I need some way to use this as a byte array in c#. Something like

byte[2][3] ras = {{1,2,3},{4,5,6}}

I have a lot of uint8 arrays, so doing it manually is not an option. Anya ideas?

OmG
  • 18,337
  • 10
  • 57
  • 90
Casper Thule Hansen
  • 1,510
  • 2
  • 19
  • 36

1 Answers1

0

If I understand the comments to your question above, you are simply missing a bit of C# syntax.

The C# syntax would be:

byte[][] ras = new byte[][] {new byte[] {1,2,3}, new byte[] {4,5,6}};

It's quite a bit more verbose than the equivalent c++, but easily translated mechanically with sed.

Chris Judge
  • 1,952
  • 1
  • 13
  • 10