调用C+的dll出现一个错误,请大神帮忙看看错在哪里
try
{
byte[] array2;
byte* ptr;
if ((array2 = array) != null && array2.Length != 0)
{
fixed (byte* ptr1 = &array2[0])
{
}
}
else
{
ptr = null;
}
for (long num2 = 0L; num2 < (long)num; num2 += 3L)
{
//这里报错 Operator '/' cannot be applied to operands of type 'System.IntPtr' and 'System.IntPtr'
byte b = ptr[(IntPtr)num2 / 1];
//这里报错 Operator '/' cannot be applied to operands of type 'System.IntPtr' and 'int'
ptr[(IntPtr)num2 / 1] = *(ptr + (IntPtr)(num2 + 2L) / 1);
//这里也报错 Operator '/' cannot be applied to operands of type 'System.IntPtr' and 'int'
ptr[(IntPtr)(num2 + 2L) / 1] = b;
}
}
finally
{
byte* ptr = null;
}
请大神帮忙解决一下啊