converting float to char string

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

converting float to char string

3,820 次查看
rickross
Contributor I
I am currently using Codewarrior 5. I want to write float numbers to Hyperterminal using the write command but so far I have been unsuccesful. I can however write characters. I tried using the gcvt() function to convert the float to a character string but codewarrior doesn't recognise it. Any ideas or examples or application notes I can use to write floats to Hyperterminal? 
标签 (1)
标记 (1)
0 项奖励
回复
1 回复

972 次查看
CrasyCat
Specialist III
Hello
 
What about using printf?
sprintf can be used to convert a float to a string (array of char).
Several output format are possible. Please check ANSI C documentation to find out the one which suits best your needs.
 
CrasyCat
0 项奖励
回复