#include <memory>
#include <string.h>
#include <iostream>
using std::tr1::shared_ptr;
using std::cout;
void arr_delete(char *ptr)
{ // delete array of char
delete [] ptr;
}
int main()
{ // demonstrate stream inserter
shared_ptr<int> sp(new int);
cout << "shared_ptr<int>: " << sp << ", " << sp.get() << '\n';
char *cptr = new char[100];
shared_ptr<char> cp(cptr, arr_delete);
strcpy(cp.get(), "contents of character array");
cout << cp << '\n';
return 0;
}