我有一个数组,我想将它分配给另一个数组变量。这是代码
for (int i = 0; i < length; i++)
{
arr1[i] = Convert.ToByte(Tag_uid.Substring(2 * i, 2), 16);
}
//Create an array to hold the Command Packet
byte[] CommandPacket = new byte[9];
CommandPacket[0] = arr1; //ERROR: cannot convert type byte[] to byte
如何将整个数组值分配给commandpacket[0]
?
答案 0 :(得分:0)
怎么样
for (int i = 0; i < length; i++)
{
arr1[i] = Convert.ToByte(Tag_uid.Substring(2 * i, 2), 16);
}
byte[][] CommandPacket = new byte[9][];
CommandPacket[0] = arr1;