sprintf function

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

sprintf function

1,612 次查看
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 回复数

1,326 次查看
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 项奖励
回复

1,326 次查看
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 项奖励
回复