【发布时间】:2015-05-03 23:00:47
【问题描述】:
我正在 Eclipse 中编写一个 c 程序来接收来自串行设备的数据。
它正确接收数据并将其存储在接收缓冲区中。我正在使用printf 语句以hex 格式仅将缓冲区的4th,3rd 和2nd 元素打印到控制台。
下面是代码:
printf ("Output is %02x %02X %02X\n\n", receivebuffer[4], receivebuffer[3], receivebuffer[2]);
它给出以下输出:
Output is 98 0E 88
是否有任何可能的方法可以删除每个字节之间的空格。我想要以下格式的输出:
Output is 980E88
c中是否有任何功能可以删除空格。请帮忙。谢谢。
【问题讨论】: