Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- typedef union {
- int i;
- float f;
- } ambivalent_union;
- //My plan is for this macro to work for both ints and floats.
- #define MY_MACRO( some_expression ) \
- ambivalent_union u = (ambivalent_union)(some_expression); \
- printf("If the expression returned a float, it would be %f", ambivalent_union.f); \
- printf("If the expression returned an int, it would be %d", ambivalent_union.i);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement