文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
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);

相关阅读 更多 +
排行榜 更多 +
开心动动脑安卓版 v1.0 手机版

开心动动脑安卓版 v1.0 手机版

休闲益智 下载
不良人破局手游下载

不良人破局手游下载

角色扮演 下载
云海之下手游下载

云海之下手游下载

角色扮演 下载