[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[microblaze-uclinux] how is a float variable stored in a memory location?



hi all,
 
does anyone know how is a float variable is stored in a memory of 4 bytes??
 
 
i wanted to knw how to read the value from that memory location?
 
say..
-----------------------------------------
float a = 15.35;
char * ptr;
 
ptr = (char*) &a;
 
for ( i = 0;i< sizeof(float) ; i++) {
        printf("Address = %x \n", ptr + i );
        printf("value at address is  = %x \n", *( (char *) (ptr + i ))  );
 
}