sprintf function

cancel
Showing results for 
Search instead for 
Did you mean: 

sprintf function

431 Views
kdn
Contributor III

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

 

 

what in place of %d?

Labels (1)
Tags (2)
0 Kudos
2 Replies

145 Views
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 Kudos

145 Views
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 Kudos