见书P49
#include <stdio.h>
#include <inttypes.h>
int main()
{
int32_t me32;
me32=45933945;
printf("First,assume int32_t is int :");
printf("me32=%d\n",me32);
printf("Next,let's not make any assumptions.\n");
printf("Instead,use a\"macro\"from inttypes.h:");
printf("me32=%" PRId32 "\n",me32);
return 0;
}
//仅仅于c中存在 include <inttypes.h> ,必须以.c的文件格式保存,若以.cpp格式保存,编译会通不过
//该头文件中定义了PRId32字符串宏,于是可以用%"PRId32" 来显示可移植类型;“32”可根据变化定义的宽度来变化