Skip to content

Instantly share code, notes, and snippets.

@dm4
Created July 24, 2013 18:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dm4/6072958 to your computer and use it in GitHub Desktop.
Save dm4/6072958 to your computer and use it in GitHub Desktop.
原來 double 是指標啊
#include <stdio.h>
int main(int argc, const char *argv[]) {
double d = 12.34;
printf("d 0x%016x\n", d);
printf("&d 0x%016x\n", &d);
printf("*(long long *)&d 0x%016lx\n", *(long long *)&d);
return 0;
}
// d 0x0000000056b164a0
// &d 0x0000000056b16460
// *(long long *)&d 0x4028ae147ae147ae
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment