how to use sprintf

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

how to use sprintf

1,901 次查看
omkar787898
Contributor II

i am trying to display hex value on terminal, but it needs to be char so i can display so i  want to use sprintf but is giving error 1. I added stdio.h also. How i can use sprintf in lpcexpresso?

0 项奖励
1 回复

1,350 次查看
lpcxpresso_supp
NXP Employee
NXP Employee

Look in the Build Log (The Build Console ) or the Problems View to find the actual error you are encountering, rather than just looking at the final "error 1" message.

The most likely cause of problems calling sprintf() though are that you are linking with the wrong library variant. You need to use "nohost" or "semihost". For more details see:

Alternatively, you might also want to check out the itoa() function:

https://community.nxp.com/message/630652 

Regards,

LPCXpresso Support

0 项奖励