阅读背景:

C:双号(例如123.45)是如何存储在浮动变量或双变量或长双变量的?

来源:互联网 
#include <stdio.h>

int main () {
float a = 123.0; 

unsigned char ch, *cp;
ch = 0xff;

cp = (unsigned char *) &a;
printf ("%02x", ch&(*(cp+3)));
printf ("%02x", ch&(*(cp+2)));
printf ("%02x", ch&(*(cp+1)));
printf ("%02x\n", ch&(*(cp+0)));

/*I have written this program to see binary representation, but I can not understand the output, the binary representation?
}
#include <stdio.h>

int main () {
float a = 123



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: