下面显示的代码是 Visual C++
array<Byte>^ b = gcnew array <Byte> (filesize);
fs->Read(b,0,b->Length);
unsigned char *pb;
pb=(byte*)malloc(b->Length); //pb is unmanaged here.
for(int i=0;i<b->Length;i++)
{
*(pb+i)=InverseByte(b+i);
}
我想调用下面的函数来反转每个字节。我怎样才能做到这一点?我想对托管数组b的每个字节进行逆运算,并将其放入非托管数组b中。
unsigned char InverseByte(unsigned char* PbByte)
{
//something;
}