boost-内存管理(scoped_array)

    1. # 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;
    }

posted @ 2015-12-20 21:17  OracleLoyal  阅读(433)  评论(0编辑  收藏  举报