Created
September 30, 2014 07:27
-
-
Save jagt/09e535f7d886df29217e to your computer and use it in GitHub Desktop.
print int as float for memory edit
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
#include <stdio.h> | |
#include <stdlib.h> | |
int main(int argc, char **argv) { | |
int i; | |
float f; | |
if (argc < 2) | |
{ | |
puts("usage: cnv 1065353216\n"); | |
return -1; | |
} | |
i = atoi(argv[1]); | |
f = *((float*)(&i)); | |
printf("%f\n", f); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment