Created
October 20, 2009 21:49
-
-
Save bitbckt/214648 to your computer and use it in GitHub Desktop.
This file contains 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
struct foo { | |
int type; | |
#define TYPE_INT 1 | |
#define TYPE_PAIR_OF_INTS 2 | |
#define TYPE_STRING 3 | |
union { | |
int i; // If type == TYPE_INT. | |
int pair[2]; // If type == TYPE_PAIR_OF_INTS. | |
char *str; // If type == TYPE_STRING. | |
} u; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment