请问Ushort类型的输出格式是什么?给位师兄师姐帮帮忙啊!

zhang4168855 2012-08-24 10:32:14
我想Trace一个Ushort类型的数据,请问一下怎么写代码 ?
...全文
164 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
赵4老师 2012-08-24
  • 打赏
  • 举报
回复
Size and Distance Specification
The optional prefixes to type, h, l, and L, specify the “size” of argument (long or short, single-byte character or wide character, depending upon the type specifier that they modify). These type-specifier prefixes are used with type characters in printf functions or wprintf functions to specify interpretation of arguments, as shown in the following table. These prefixes are Microsoft extensions and are not ANSI-compatible.

Table R.6 Size Prefixes for printf and wprintf Format-Type Specifiers

To Specify Use Prefix With Type Specifier
long int l d, i, o, x, or X
long unsigned int l u
short int h d, i, o, x, or X
short unsigned int h u
__int64 I64 d, i, o, u, x, or X
Single-byte character with printf functions h c or C
Single-byte character with wprintf functions h c or C
Wide character with printf functions l c or C
Wide character with wprintf functions l c or C
Single-byte – character string with printf functions h s or S
Single-byte – character string with wprintf functions h s or S
Wide-character string with printf functions l s or S
Wide-character string with wprintf functions l s or S


Thus to print single-byte or wide-characters with printf functions and wprintf functions, use format specifiers as follows.

To Print Character As Use Function With Format Specifier
single byte printf c, hc, or hC
single byte wprintf C, hc, or hC
wide wprintf c, lc, or lC
wide printf C, lc, or lC


To print strings with printf functions and wprintf functions, use the prefixes h and l analogously with format type-specifiers s and S.
赵4老师 2012-08-24
  • 打赏
  • 举报
回复
"%hu"

1,649

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 非技术类
社区管理员
  • 非技术类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧