In the following programme I'm using the auto_ptr pointer. All is good but when I try to print the value of the pointer, it prints out some memory location. Why?
Code:#include <iostream> #include <memory> using namespace std; int main(int argc, char *argv[]) { auto_ptr<int> number(new int); *number = 1; cout << "My number is " << number.get() << endl; cin.get(); return(0); }