how to change float to char*
-
HI,Guys I tried all methods I know,but it seems all the methods don't work?Could anyone help me? YES, I am here.
-
HI,Guys I tried all methods I know,but it seems all the methods don't work?Could anyone help me? YES, I am here.
char buffer[100]; sprintf(buffer,"%f",floatvalue); bb |~ bb
-
char buffer[100]; sprintf(buffer,"%f",floatvalue); bb |~ bb
-
HI,Guys I tried all methods I know,but it seems all the methods don't work?Could anyone help me? YES, I am here.
When I look at the answers I see that both answers are completly different. The first casts the float to a char* so that you can look at the bits of how the processor encoded the float. I am not sure why you would want that. [EDIT] Also if you want that you should use BYTE or unsigned char instead. [/EDIT] The second returns a string that represents the float number. This is more likely what you want. Which one are you looking for? John
-
That won't work at all. Ryan Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"