BYTE, WORD and DWORD macros definition

前端 未结 2 1480
小蘑菇
小蘑菇 2021-01-12 17:52

I am trying to understand, what would be the best way to define BYTE, WORD and DWORD macros, which are mentioned in answers of this qu

2条回答
  •  旧巷少年郎
    2021-01-12 18:21

    This is a portable solution:

    #include 
    
    typedef uint32_t DWORD;   // DWORD = unsigned 32 bit value
    typedef uint16_t WORD;    // WORD = unsigned 16 bit value
    typedef uint8_t BYTE;     // BYTE = unsigned 8 bit value
    

提交回复
热议问题