Does C# support struct bit definitions? RRS feed

  • Question

  • Does C# support struct bit definitions?. 

    For example is there a way to declare a structure like this in

    typedef struct

    { UINT16 SrcPort;

    UINT16 DstPort;

    UINT16 Reserved1:4;

    UINT16 HdrLength:4;

    UINT16 Fin:1;

    UINT16 Syn:1;  } T<st1:stockticker>CPHD</st1:stockticker>R

    Please help me to convert this c++ structure to c# structure? It is very urgent.

    How can we set bit positions in a C# Structure ? 

    Thursday, September 19, 2013 12:11 PM