Hi all!
Please somebody explain me how this snippet is working!!

main()
{
float a 4.379;
char*p;
int i;
p=(char*)&a;
for(i=1;i<=3;i++)
printf("%02X",(unsigned char)p[i]);
}

Hi all!
Please somebody explain me how this snippet is working!!

main()
{
float a 4.379;
char*p;
int i;
p=(char*)&a;
for(i=1;i<=3;i++)
printf("%02X",(unsigned char)p[i]);
}

The code simply assigns the address of "a" to the character pointer "p" and then proceeds to check the value of the four bytes at address p[0], p[1],p[2], and p[3]...

Well it looks like that's what it's supposed to do.
It should print the hex representation of the floating point number 4.379.

But I don't see how it will compile and it will only print 3 of the 4 hex bytes.