While Reading The Book , I Got The Codes Below: #include #include
#pragma Warning (Disable: 4297)
Using namespace std;
Class buffer {public: explicit buffer (size_t) throw (); ~ buffer () throw (); private: char * const p;}
Buffer :: buffer (size_t const count) Try: p (new char [count]) {cout << "constructor goes well ..." << endl;} catch (...) {throw "hello" Abort ();
Buffer :: ~ buffer () {delete [] p; cout << "Destructor Also Goes Well ..." << endl;}
Static void do_something_with (buffer &) throw () {cout << "Something is done!" << endl;}
INT main () {buffer b (100); do_something_with (b); return 0;}