Access violation when using pin_ptr?
问题 When I use pin_ptr to pass an array in native c code, I get access violation. The code is as bellow: array<float>^ LogLikelihoodScore(array<array<unsigned char>^>^ modelsBuffer , array<float>^ featuresArray, int numberOfFrames) { int i, j, modelsNum = modelsBuffer->Length, len; float **models = (float**) malloc(modelsNum * sizeof(void*)); for(i = 0; i < modelsNum; i++) { pin_ptr<unsigned char> ptr = &modelsBuffer[i][0]; models[i] = (float*) ptr; } array<float>^ scores = gcnew array<float>