"Untitled" By GGMethos (https://pastebin.com/u/GGMethos) URL: https://pastebin.com/EweXSH3e Created on: Thursday 19th of September 2013 07:41:29 PM CDT Retrieved on: Monday 26 of October 2020 05:56:10 AM UTC #include "Hello.h" #include int main(int argc, char** args, char** argsenv) { Hello h = Hello() ; Hello* ph = new Hello (); Hello* phArgument; cout << argc << std::endl; for (int i = 0 ; i < argc; i++ ) cout << *(args+i) << std::endl; try { phArgument = new Hello ("One Ring to rule them all"); } catch (std::invalid_argument ia) { cerr << "Invalid argument, Hello not passed to constructor, Passed-" << ia.what() << endl ; } try { ph -> setcshelloReply ("One Ring to rule them all\n"); } catch (std::out_of_range l) { cerr << "Hello exceeded String Length " << l.what() << endl ; } catch(...) { cerr << "Error not Caught..." << std::endl; return 0; } cout << ph -> getcshelloReply(); try { h.setcshelloReply ("Mordor - One Ring to rule them all, One Ring to find them, One Ring to bring them all and in the darkness bind them\n"); } catch (std::out_of_range l) { cerr << "Hello exceeded String Length " << l.what() << endl ; } catch (Hello::Length l ) { assert (l.getLength()!=0); cerr << " String overflow - " << l.getLength() << " needed" << std::endl; } catch (std::bad_alloc alloc) { } catch (std::bad_cast cast) { } catch (std::bad_exception be) { } catch (std::overflow_error ofe) { } catch(...) { cerr << "Error not Caught..." << std::endl; } cout << h.getcshelloReply(); return 0; }