参数类型:
typedef struct s1
  {
    short a
    short b[6];
  }
请问b参数如何传递?
c#代码:
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
public struct s1
{
  short a;
  ????
}

解决方案 »

  1.   


    [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] 
    public struct s1 

    short a; 
    short []b=new short[6];

      

  2.   

    [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] 
    public struct s1 

      short a; 
      shrot b[6] 
      

  3.   

    [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]  
    public struct s1  
    {  
      short a;  
     [MarshalAs(UnmanagedType.ByValArray   ,   SizeConst   =   6)]   
     shrot[]   b;                   
    }  忘记是那个了..你试下