#include<iostream>
#include<stdlib.h>
using namespace std;
int main()
{
int *p=new int(10);
if(p==NULL)
{
system("pause");
return 0;
}
cout<<*p<<endl;
delete p;
p=NULL;
system("pause");
return 0;
#include<stdlib.h>
using namespace std;
int main()
{
int *p=new int(10);
if(p==NULL)
{
system("pause");
return 0;
}
cout<<*p<<endl;
delete p;
p=NULL;
system("pause");
return 0;
}
//
#include<iostream>
#include<stdlib.h>
using namespace std;
int main()
{
int *p=new int[100];
if(p==NULL)
{
system("pause");
return 0;
}
p[0]=1;
p[1]=2;
p[2]=3;
cout<<p[0]<<","<<p[1]<<","<<p[2]<<endl;
delete []p;
p=NULL;
system("pause");
return 0;
}
#include<iostream>
#include<string.h>
using namespace std;
int main()
{
char *p=new char[100];
strcpy(p,"Hello imooc");
cout<<p<<endl;
delete []p;
p=NULL;
return 0;
system("pause");
return 0;
}