Floating point to hexadecimal, arranged by the most "important" bits
Hi, I have this assignment to do, in which the program asks the user for floating point input, after getting this the floating point is printed as a hexadecimal bit by bit, arranging so that the most important bit is first etc.
This is what I get, it seems to work quite properly on presenting the hexadecimal sometimes. Sometimes it just prints a whole lot of F's even though they really should not be there. Could someone please guide me to the righ direction?
Clearly I'm not arranging these yet, first I'd like it to present the data correctly.
int main (void)
printf("Type a floating point:\n");
ptr = &nbr;
printf("\Number %lf as a hexadecimal is \n", nbr);
printf("%X ", *ptr++);