#include <stdio.h>
#include <string.h>
#include <malloc.h>
//#include <new>
struct CLS
{
int m_i;
CLS( int i ):m_i(i) {}
CLS()
{
new (this) CLS(0);//如果用到placement new这个叫做定位new,用这个new是不分配内存的
}
~CLS()
{
printf("destory!\n");
}
};
int main(int argc, char* argv[])
{
CLS * c1=new CLS[3];
printf("%d\n",c1[0].m_i);
delete [] c1;
return 0;
}