Hello
I wrote the following code, and got an error:
unsafe void Get_ADC_Samples_From_All_Enabled_Channels(TextBox tb_OutputNumber_ADC, TextBox tb_Voltage_ADC)
{
bool got;
double[,] channelData = new double[64,8];
double*[] voltagePointerArray = new double*[64];
for (int i = 0; i != 64; i++)
{
voltagePointerArray[i] = &(channelData[i, 0]);
got = digitalIODll.getADCSamplesFromAllEnabledChannels( 8, &voltagePointerArray[i] );
if (got == true)
{
tb_Voltage_ADC.Text = "1";
}
else
{
tb_Voltage_ADC.Text = "2";
}
}
}
Error 2 You can only take the address of an unfixed expression inside of a fixed statement initializer
I do not understand what this means, can anyone please verify this for me.
Thanks
Muhu

1 answers
As channelData and voltagePointerArray are managed arrays, you need to 'pin' them (using the 'fixed' statement) before you can take addresses of their elements:
answered 2 years ago by:
17279