boost-内存管理(scoped_array)
- # include <algorithm>
string *p=new string[20];
scoped_array<string> sp(p);
fill_n(&sp[0],20,"zhaoxi");
{
sp[0]="100";
cout<<sp[0].size()<<endl;
}
string *p=new string[20];
scoped_array<string> sp(p);
fill_n(&sp[0],20,"zhaoxi");
{
sp[0]="100";
cout<<sp[0].size()<<endl;
}