文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>[转载]keil c51中printf 与标准c有别...

[转载]keil c51中printf 与标准c有别...

时间:2010-08-14  来源:tommyqq

QUESTION

I can get the printf command to work with integers but not long integers or 8-bit integers. Why?

ANSWER

KEIL里扩展出了b,h,l来对输入字节宽的设置:
(1)b八位
(2)h十六位
(3)l三十二位

在Keil C51中用printf输出一个单字节变量时要使用%bd,如
unsigned char counter;
printf("Current count: %bd\n", counter);

而在标准C语言中都是使用%d:
printf("Current count: %d\n", counter);

相关阅读 更多 +
排行榜 更多 +
打螺丝拧不住拔钉子游戏下载

打螺丝拧不住拔钉子游戏下载

休闲益智 下载
三国乱世霸王手游下载

三国乱世霸王手游下载

策略塔防 下载
我的穿越人生游戏下载

我的穿越人生游戏下载

模拟经营 下载