Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

c# sequential struct with fixed array size

[StructLayout(LayoutKind.Sequential)]
struct Foo
{
    public ushort W;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 20)]
    public byte[] X;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 10)]
    public Inner[] data;
}
Source by www.codeproject.com #
 
PREVIOUS NEXT
Tagged: #sequential #struct #fixed #array #size
ADD COMMENT
Topic
Name
2+8 =