Created
August 1, 2013 16:54
-
-
Save lasconic/6133180 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
#include <stdio.h> | |
int main(int argc, char* argv[]) | |
{ | |
union U { | |
int subtype; | |
struct { | |
int _accidentalType:4; | |
int _naturalType:4; | |
unsigned _customType:16; | |
bool _custom : 1; | |
bool _invalid : 1; | |
}; | |
}; | |
U a; | |
a.subtype = 15; | |
printf("_accidentalType %d\n" , a._accidentalType); | |
printf("_naturalType %d\n" , a._naturalType); | |
printf("_customType %d\n" , a._customType); | |
printf("_custom %d\n" , a._custom); | |
printf("_invalid %d\n" , a._invalid); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment