110,553
社区成员
发帖
与我相关
我的任务
分享
byte[,] f = { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { 1, 1, 1, 1, 0, 0, 0, 0, 0, 0 }, { 0, 1, 0, 0, 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 1, 0, 0, 0, 1, 0, 0 } };
IntPtr dest = Marshal.UnsafeAddrOfPinnedArrayElement(f, 0);
byte[] b = new byte[f.Length / f.GetLength(0)];
Marshal.Copy(dest, b, 0, f.GetLength(0));
byte[][] f = { new byte[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, new byte[] { 1, 1, 1, 1, 0, 0, 0, 0, 0, 0 }, new byte[] { 0, 1, 0, 0, 0, 0, 0, 0, 0, 0 }, new byte[] { 0, 0, 0, 1, 0, 0, 0, 1, 0, 0 } };
for (int i = 0; i < f.Length; i++)
{
byte[] b = f[i];
}
byte[,] f = { { 1, 2, 3, 4, 5, 6, 7, 8,9, 0 }, { 1, 1, 1, 1, 0, 0, 0, 0, 0, 0 },{ 0, 1, 0, 0, 0, 0, 0, 0, 0, 0 },{ 0, 0, 0, 1, 0, 0, 0, 1, 0, 0 } };
byte[] B = new byte[f.GetLength(1)];
for (int i =f.GetLowerBound(1) ; i <f.GetUpperBound(1); i++)
{
B[i] = f[0, i];
}
foreach (var item in B)
{
Console.Write("{0} ", item);
}
byte[][] b = { new byte[]{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
new byte[]{ 1, 1, 1, 1, 0, 0, 0, 0, 0, 0 },
new byte[]{ 0, 1, 0, 0, 0, 0, 0, 0, 0, 0 },
new byte[]{ 0, 0, 0, 1, 0, 0, 0, 1, 0, 0 } };