converting float to char string

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

converting float to char string

3,825件の閲覧回数
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 返信

977件の閲覧回数
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 件の賞賛
返信