C++boost智能指针share_array的使用

 


#include "Number.h"
#include <iostream>
#include <stdio.h>
#include "Person.h"
#include <string>
#include <boost/smart_ptr.hpp>
using namespace boost;
using namespace std;

void main()
{
boost::shared_array<int> pArrayDatas(new int[20]);
for (int i = 10; i < 30; ++i)
{
pArrayDatas[i-10] = i;
}

for (int j = 0; j < 20; ++j)
{
cout << pArrayDatas[j] << endl;
}

int wait ;
cin >> wait;

return ;

posted @ 2013-07-01 21:00  Predator  阅读(1694)  评论(0编辑  收藏  举报