Created
December 6, 2012 14:39
-
-
Save hhyyy9/4224875 to your computer and use it in GitHub Desktop.
位定义
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| typedef struct bitS | |
| { | |
| unsigned bit0:1; | |
| unsigned bit1:1; | |
| unsigned bit2:1; | |
| unsigned bit3:1; | |
| unsigned bit4:1; | |
| unsigned bit5:1; | |
| unsigned bit6:1; | |
| unsigned bit7:1; | |
| }pbitS; | |
| typedef union byteB | |
| { | |
| struct bitS b; | |
| unsigned char c; | |
| }uByteB; | |
| 使用的地方: | |
| union byteB a; | |
| a.b.bit0=1; | |
| a.b.bit3=1; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment