QQ群里问的关于sizeof问题
来源:互联网 发布:淘宝关键词搜索在哪 编辑:程序博客网 时间:2024/05/16 14:57
#include "iostream.h"#include "stdlib.h"typedef struct {int a;char b;short c;}Fuck_t;int main(){cout<<sizeof(Fuck_t)<<endl;}
#include "iostream.h"#include "stdlib.h"typedef struct {short c;short d;int a;char b;}Fuck_t;int main(){cout<<sizeof(Fuck_t)<<endl;return 0;}
#include "iostream.h"#include "stdlib.h"typedef struct { long d:1; short c:1; int a:3; char b;}Fuck_t;int main(){ cout<<sizeof(Fuck_t)<<endl; return 0;}
#include "iostream.h"#include "stdlib.h"typedef struct { short c; long d; int a; char b;}Fuck_t;int main(){ cout<<(size_t)&(((Fuck_t*)0)->a)<<endl; return 0;}
解释见:http://zhidao.baidu.com/question/334619905.html
sizeof的用法见下一博客:http://blog.csdn.net/wuyuan2011woaini/article/details/7765347
复制搜索
复制搜索
复制搜索
复制搜索
复制搜索
复制搜索
复制搜索
复制搜索
- QQ群里问的关于sizeof问题
- 关于sizeof的问题
- 关于sizeof的最大值问题
- 关于sizeof的细节问题
- 关于sizeof的误用问题
- 关于sizeof的相关问题
- 关于sizeof(str)的问题
- 关于sizeof注意的问题
- QQ群里问的关于%的问题
- QQ群里问的关于偏移字节问题
- struct 关于sizeof的大小问题
- sizeof(struct)--关于字节对齐的问题
- 关于求sizeof(struct)“不正确”的问题
- 关于struct调用sizeof的一个问题
- 关于sizeof的问题(1)
- 关于sizeof的问题(3)
- 关于sizeof(struct student)的问题
- 关于数组,sizeof(),strlen的计算问题
- struts1之action及actionmapping
- Game center account services are currently unavaiable for iOS Simulator
- Android 其它资源类型
- preg_replace 代码执行原理
- c++在vc++中的应用基础(1)
- QQ群里问的关于sizeof问题
- Java中final的简单使用说明
- 【设计模式】之MVC设计模式
- 摘录3
- Qt源码分析之信号和槽机制
- Android之NDK开发(手把手)
- c# 窗体传值汇总
- osg学习之一:基础
- c++中while和for的优缺点