c语言二级指针简单练习
char **str;
char *p=(char *)malloc(1024);
memset(p,0,1024);
strcpy(p,"123w213");
str=&p;
cout<<*str<<endl;
if(str)
{
free(str);
str=NULL;
cout<<"free"<<endl;
}
char **str;
char *p=(char *)malloc(1024);
memset(p,0,1024);
strcpy(p,"123w213");
str=&p;
cout<<*str<<endl;
if(str)
{
free(str);
str=NULL;
cout<<"free"<<endl;
}