C语言定义
struct SerialNum
{
int id;
char msg[32];
};
struct Staff
{
SerialNum * pSNs;
int nCount;
};
java 调用,
把结构体用class 调用
//包含字符数组的结构
public static class SerialNum extends Structure
{
public static class ByReference extends SerialNum implements Structure.ByReference {};
public static class ByValue extends SerialNum implements Structure.ByValue{};
public int id;
public byte msg[] = new byte[32];
public SerialNum(){
this.allocateMemory();
}
public int setMSG(String str){
return StringToFixedBytes(str, msg);
}
public String getMsg(){
return BytesToString(msg);
}
//用于带数组指针的结构
public static class Staff extends Structure{