We don’t allow questions seeking recommendations for software libraries, tutorials, tools, books, or other off-site resources. You can edit the question so it can be answered with facts and citations.
Closed 9 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(4)
尝试 http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/ inttypes.h.html 首先。
有关如何使用新的可移植格式化宏的更好示例,请参见 avr- libc。我提供了一个示例(来自链接)来进行说明。 QNX 库也有更好的人类- 可读的描述(如果您不喜欢冷酷地阅读规范),尽管您必须滚动到页面末尾才能了解描述的实质内容。
请注意,这使用“String”“String”隐含连接运算符来生成字符串(在此示例中)
尝试分解命名约定似乎表明:(
因此 PRIx8 表示 printf 格式指令,用于格式化为十六进制八位。
Try http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/inttypes.h.html for a start.
A better example of how to use the new portable formatting macros was found in avr-libc. I've included an example (from the link) to illustrate. QNX libraries also have a better human-readable description (if you don't like reading the specification cold), although you have to scroll nearly to the end of the page to get to the meat of the descriptions.
Note that this uses the "String" "String" implied concatenation operator to yield the string (in this example)
An attempt to decompose the naming convention seems to indicate:
so
PRIx8
means printf format instruction to format to hexadecimal eight bits.我总是遵循标准(PDF 链接 )对于那些事情;一旦你弄清楚它们的设置模式,它们就不会太复杂。相关部分是§7.8整数类型的格式转换
。I always go to the standard (PDF link) for those things; they're not too complicated once you figure out the patterns they're set up in. The relevant section is §7.8 Format conversion of integer types
<inttypes.h>
.HP 有一个关于编写可移植代码的很好的参考,并且他们给出了一些使用 inttypes.h 的具体建议
编写可移植代码
HP Has a good reference on writing portable code and they give some specific advice for using inttypes.h
Writing Portable Code
我总是从维基百科开始查找标题。
在维基百科上似乎有很大问题。我接下来要采取的步骤是访问此网站。上一个站点列出了每个宏并给出了示例。您还可以查看此网站,它实际上向您展示了头文件。我认为这些都不是真正的教程,但它们是一个很好的起点。I always start at Wikipedia to look up a header.
<inttypes.h>
seems to be very problematic on Wikipedia. The next step I would then take is going to this site. This previous site lists every macro and does give an example. You could also check out this site, which actually shows you the header file. I don't think that any of those are really tutorials per say but they are a good jumping off point.