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]...
Last edited by gerard4143; Oct 24th, 2009 at 8:20 pm.
Reputation Points: 499
Solved Threads: 367
Postaholic
Offline 2,197 posts
since Jan 2008