#include <iostream>
int main(void){
using namespace std;
int night = 1001;
int * pt = new int;
*pt = 1001;
cout<<"night value = "<<night<<" ; location "<<&night<<endl;
cout<<"int "<<"value = "<<*pt<<" ; location "<<pt<<endl;
double *pd = new double;
*pd = 10001.0;
cout<<"double value = "<<*pd<<" ; location "<<pd<<endl;
cout<<"size of double = "<<sizeof(double)<<"; size of pd : "<<sizeof(pd)<<" size of *pf : "<<sizeof(*pd)<<endl;
cout<<"size of int = "<<sizeof(int)<<"; size of pt : "<<sizeof(pt)<<"size of *pt : "<<sizeof(*pt)<<endl;
delete pd;
cout<<"delete pd"<<" pd is :"<<pd<<endl;
delete pt;
cout<<"delete pt"<<" pt is :"<<pt;
return 0;
}
new和delete相当于malloc和free