65,187
社区成员




#include<string>
#include<iostream>
#include <boost/cstdint.hpp>
using namespace std;
class C1
{
public:
int m_Data[4];
};
int main()
{
printf("%d \n",sizeof(C1));
// 動態配置記憶體
C1* pc1 = new C1; // size:16
C1* pc12 = new C1; // size:16
C1* pc13 = new C1; // size:16
// 列印每個區塊之前的㆕個bytes
unsigned char* pc1c = (unsigned char*)pc1;
unsigned char* pc12c = (unsigned char*)pc12;
unsigned char* pc13c = (unsigned char*)pc13;
// 列印每㆒區塊的起始位址
printf("%p %p %p\n", pc1,pc12,pc13);
}