Last active
August 29, 2015 14:23
-
-
Save 2bbb/c8c7e2a0a2c2740ab5b3 to your computer and use it in GitHub Desktop.
hex_print_again
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 <iostream> | |
| union IntFloatUnion { | |
| int i; | |
| float f; | |
| }; | |
| using namespace std; | |
| int main(int argc, char *argv[]) { | |
| IntFloatUnion u; | |
| u.f = 7.1f; | |
| printf("0x%04X\n", u.i); | |
| return EXIT_SUCCESS; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment