#include #include #include using namespace std ; main() { auto_ptr p1(new int) ; // standard init auto_ptr p2(p1) ; // change of ownership auto_ptr p3 ; // not initialized int n = *p2 ; // dereference auto_ptr p4(new string("foobar")) ; int length = p4->size() ; cout << "sizeof(auto_ptr) = " << sizeof(auto_ptr) << endl ; }