[英]Jagged Uint8 array convert to C# byte
I have a jagged uint8
array like this in c++: 我在c ++中有一个锯齿状的uint8
数组:
UINT8 ras[2][3] = {{1,2,3},{4,5,6}}
I need some way to use this as a byte array in c#. 我需要某种方法将其用作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. 我有很多uint8
数组,因此手动执行此操作不是一种选择。 Anya ideas? 有想法吗?
If I understand the comments to your question above, you are simply missing a bit of C# syntax. 如果我理解上面对您的问题的评论,则您只是缺少了一些C#语法。
The C# syntax would be: C#语法为:
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. 它比等效的c ++更加冗长,但是可以轻松地用sed进行机械翻译。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.