C to C# struct with union byte array Map

128 Views Asked by At
typedef union
{
    volatile struct
    {                                      //Init 
        UINT64      ARG1                : 1; //800H
        UINT64      ARG2                : 1; //800H
        UINT64      ARG3                : 1; //00H
        UINT64      ARG4                : 1; //00H      
        UINT64      ARG5                : 2; //00H  
        UINT64      ARG6                : 1; //00H  
        UINT64      ARG7                : 1; //00H  
        UINT64      ARG8                : 8; //00H  
        UINT64      ARG9                : 16;//00H  
        UINT64      ARG10               : 8; //00H  
        UINT64      ARG11               : 8; //00H  
        UINT64      ARG12               : 8; //00H  
        UINT64      ARG13               : 8; //00H          
    }Signal;
    UINT8               Data[8];    
}Pack;

I want to know how to implement data in c#. I know I could use StructureLayout, but the declared memory size is different from c. I want the output to be 00-00-80-00-00-00-00-00-00.

0

There are 0 best solutions below