不知道下面有沒有錯,我是這麼寫的,如有錯的話,請回帖
C++
BYTE Device_Info[MAX_DATA];
memset(Device_Info, 0x00, MAX_DATA * sizeof(byte));
C#
byte[] Device_Info =new byte[MAX_DATA];
Array.Clear(Device_Info, 0, Device_Info.Length);
C++
BYTE Device_Info[MAX_DATA];
memcpy(Device_Info, data + 7, nlength * sizeof(byte));
C#
byte[] Device_Info =new byte[MAX_DATA];
data是以知的byte[];
nlength 是需要複制的長度
7表示重第7位開始複制
Array.Copy(data, 7, Device_Info, 0, nlength * sizeof(byte));
C++
BYTE Device_Info[MAX_DATA];
memcpy(Device_Info, data , nlength * sizeof(byte));
C#
nlength 是需要複制的長度
data是以知的byte[];
byte[] Device_Info =new byte[MAX_DATA];
Array.Copy(data, Device_Info, nlength * sizeof(byte));