比如a = 1;,write-date (“a”),想让lcd显示1而不是a
2条回答 默认 最新
- 我系真滴菜 2022-12-14 14:53关注
你这个是想把数字转字符串吧,可以用sprintf将数字格式化到字符串中,然后写字符串就行了,类似于:
char dsp[10] = {0}; int a = 1; sprintf(dsp, "%d", a); write-date(dsp);
解决 2无用
你这个是想把数字转字符串吧,可以用sprintf将数字格式化到字符串中,然后写字符串就行了,类似于:
char dsp[10] = {0};
int a = 1;
sprintf(dsp, "%d", a);
write-date(dsp);