#include <stdio.h>
int main() {
union {
unsigned long long v;
double f;
} u;
char static_assert_[sizeof(u.v) == sizeof(u.f) ? 1 : -1];
u.v = 1;
printf("%e\n", u.f);
return 0;
}
#include <stdio.h>
int main() {
union {
unsigned long long v;
double f;
} u;
char static_assert_[sizeof(u.v) == sizeof(u.f) ? 1 : -1];
u.v = 1;
printf("%e\n", u.f);
return 0;
}
转载于:https://my.oschina.net/2bit/blog/3065023