首页 > 其他 > 详细

程序清单3.6_altnames.c程序_《C Primer Plus》P47

时间:2018-06-06 00:49:48      阅读:292      评论:0      收藏:0      [点我收藏+]
# include <stdio.h> # include <inttypes.h> /* altnames.c -- 可移植的整数类型名 */  /*     时间:2018年06月05日 23:24:01     代码:程序清单3.6_altnames.c程序_《C Primer Plus》P47      目的:加头文件 #inlcude <inttypes.h>    */  int main(void) {     int16_t me16;     me16 = 4593;     printf("First, assume int16_t is short: ");     printf("me16 = %hd\n", me16);     printf("Next, let's not make any assumptions.\n");     printf("Instead, use a \"macro\" from inttypes.h: ");     printf("me16 = %" PRId16 "\n", me16);     return 0; } /*     在DevC++_5.11中运行结果: ---------------------------------------------------- First, assume int16_t is short: me16 = 4593 Next, let's not make any assumptions. Instead, use a "macro" from inttypes.h: me16 = 4593 -----------------------------------------------------     google翻译如下: 首先,假设int16_t很短:me16 = 4593 接下来,我们不要做任何假设。 相反,使用inttypes.h中的"宏":me16 = 4593  -----------------------------------------------------     总结:         本人对这一段程序还不甚了解其用意,有待进一步了     解。另外,在VS2010中添加头文件     #include "inttypes.h" 编译失败,待查中..........     下载了 inttypes.h 文件复件到:     C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include     在未重启的情况下,编译仍失败,待查中...... ----------------------------------------------------- */


程序清单3.6_altnames.c程序_《C Primer Plus》P47

原文:http://blog.51cto.com/13555061/2125324

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!