sprintf function

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

sprintf function

774件の閲覧回数
kdn
Contributor III

how can I use  sprintf(buffer,"%d",time_interval); to print double and long integer

 

 

what in place of %d?

ラベル(1)
タグ(2)
0 件の賞賛
2 返答(返信)

488件の閲覧回数
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi KDN,

I forgot say. if you need print floating variable, you need add floating support when create a new project. See video I just made:


Have a great day,
Zhang Jun

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 件の賞賛

488件の閲覧回数
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi KDN.

please note sprintf/printf related functions are very memory consuming. lacking stack is possible reason. 

#include <stdio.h>  is necessary to be added to support sprintf.

I don't know what chip and CW version you work with. please let me know, i can provide you a sample of it.


Have a great day,
Zhang Jun

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 件の賞賛