我需要把8字节的double转成2个4字节的int,还要把它们转回double,求救!
#include <stdio.h>
int main(int argc, char *argv[])
{
double d = 123.123;
int a = *(int *)(&d);
int b = *((int *)(&d)+1);
printf("a = %d\n", a);
printf("b = %d\n", b);
double e;
*(int *)(&e) = a;
*((int *)(&e)+1) = b;
printf("e = %f\n", e);
return 0;
}