首页 > 其他 > 详细

sizeof 4字节对齐

时间:2016-10-21 13:37:27      阅读:173      评论:0      收藏:0      [点我收藏+]
#include <iostream>

#include<assert.h>
using namespace std;



typedef struct sys{
char a;
int * b;
char c;
}sysa;

class c{
public:
    unsigned a;
    virtual void bi(c* s);
    char dd;
    static int sd;


};
int main()
{
char str2[100];

cout<<sizeof(str2)<<endl;


char str[]="jdfl中国";
char *p=str;
cout<<sizeof(p)<<endl;
cout<<sizeof(str)<<endl;
cout<<sizeof(sysa)<<endl;
cout<<sizeof(c)<<endl;
cout<<sizeof(unsigned)<<endl;
}

  64位机

100 4 9 12 12 4 

sizeof 4字节对齐

原文:http://www.cnblogs.com/8335IT/p/5984029.html

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