0
我想實現將System :: Byte的鋸齒陣列轉換爲unsigned char **的C++ \ CLI函數。 我做了這個:將System :: Byte的鋸齒陣列轉換爲無符號字符**
unsigned char** NUANCECLR::IsItYou::convertBBtoCC(array<array<System::Byte>^>^ b)
{
unsigned char** x = NULL;
for (size_t indx = 0; indx < b->Length; indx++)
{
if (b[indx]->Length > 1)
{
pin_ptr<System::Byte> p = &b[indx][0];
unsigned char* pby = p;
char* pch = reinterpret_cast<char*>(pby);
x[indx] = reinterpret_cast<unsigned char *>(pch);
}
else
x[indx] = nullptr;
}
return x;
}
我目前無法測試它,也許有人可以幫助我,告訴我,如果它是確定或沒有,因爲我需要它比較fast.Thank你!
謝謝,你是對的,我忘了分配,我的大腦是KO :) – WhiteR0205