代码:

#include <iostream>
#include <cstdio>
#include <list>
#include <string>
#include <cstdint>
#include <exception> #define PRINT_SIZE(type) printf("%-17s = %zu,inner type: %s\n", "sizeof("#type")", sizeof(type), typeid(type).name()) void print_sys_bits()
{
#ifdef _WIN64
std::cout << "x64:" << std::endl;
#else
std::cout << "x86:" << std::endl;
#endif
} void print_sizes()
{
PRINT_SIZE(void*);
PRINT_SIZE(float);
PRINT_SIZE(double);
PRINT_SIZE(short);
PRINT_SIZE(int);
PRINT_SIZE(long);
PRINT_SIZE(long long);
PRINT_SIZE(int8_t);
PRINT_SIZE(uint8_t);
PRINT_SIZE(int16_t);
PRINT_SIZE(uint16_t);
PRINT_SIZE(int32_t);
PRINT_SIZE(uint32_t);
PRINT_SIZE(int64_t);
PRINT_SIZE(uint64_t);
} int32_t main()
{
print_sys_bits();
print_sizes();
std::cin.get();
return ;
}

在不同的开发环境中,分别编译出x86程序和x64程序,观察执行结果

环境: Win10_64位 + VS2015_32位

在上面的结果中,除了指针的size不一样之外,其它的内置类型是完全相同的.

最新文章

  1. UGUI与DOtween的坑
  2. Urtext的使用
  3. Mac OS X使用快捷键改善窗口管理的六个方法
  4. 在命令行中通过adb shell am broadcast发送广播通知
  5. nginx自学
  6. java中HashMap的用法
  7. spring+hibernate--直接修改数据库,再通过hibernate查询数据不变
  8. Selenium2Library系列 keywords 之 _SelectElementKeywords 之 unselect_from_list(self, locator, *items)
  9. 为什么C/C++语言使用指针
  10. Maven工程的Web调试
  11. 在SQL中修改数据库名称
  12. HashMap 构造函数
  13. 【Qt编程】Qt学习之窗口间的相互切换
  14. FFmpeg封装格式处理4-转封装例程
  15. Jquery ajax 表单.serialize() 和serializeArray()序列化$.param()
  16. Android 利用二次贝塞尔曲线模仿购物车加入物品抛物线动画
  17. 排序算法(3)--Insert Sorting--插入排序[3]--Shell Sort--希尔排序
  18. day 85 Vue学习之vue-cli脚手架下载安装及配置
  19. python3插入数据
  20. 网站使用 rel=&quot;noopener&quot; 打开外部锚

热门文章

  1. [BZOJ1491][NOI2007]社交网络 floyd
  2. 微信商户现金红包api php
  3. 洛谷 P3397 地毯 【二维差分标记】
  4. DP重开
  5. RabbitMQ (四) 工作队列之公平分发
  6. Coloring Dominoes
  7. 微信小程序开发教程(三)项目目录及文件构成
  8. 5.5(java学习笔记)TreeSet和TreeMap
  9. Exercise02_03
  10. javolution-core-java-6.1.0.jar 的使用