在调用C++ 的函数时,有时会碰到结构体含有数组的情况。这时就需要进行转换。
注意:
C++ 中long是32位,C# 是64位,如果原始类型是long,需要转成int类型。
typedef struct CrdPrm
{
short dimension;
short profile[8];
double synVelMax;
double synAccMax;
short evenTime;
short setOriginFlag;
long originPos[8];
}TCrdPrm;
方法1 将数组按地址转写成元素
public struct TCrdPrm
{
public short dimension;
public short profile1;
public short profile2;
public short profile3;
public short profile4;
public short profile5;
public short profile6;
public short profile7