Ray's playground

 

2011年3月19日

C++ sizeof

摘要: 1#include<iostream>2usingnamespacestd;34#definemy_sizeof(type)(char*)(&type+1)-(char*)(&type)56unionu7{8doublea;9intb;10};1112unionu213{14chara[13];15intb;16};1718unionu319{20chara[13];21charb;22};2324structs425{26inti:8;27intj:4;28inta:3;29doubleb;30};3132intmain()33{34doublex;35strin 阅读全文

posted @ 2011-03-19 11:21 Ray Z 阅读(247) 评论(0) 推荐(0) 编辑

导航