int main(int argc, char **argv) { int status = EXIT_FAILURE; //guilty until proven innocent srand(static_cast(time(0))); try { game g; g.play(); status = EXIT_SUCCESS; } catch (const bad_alloc& bad) { cerr << argv[0] << ": new failed: " << bad.what() << "\n"; } catch (const exception& e) { cerr << argv[0] << ": " << e.what() << "\n"; } catch (...) { cerr << argv[0] << ": main caught unexpected exception.\n"; } return status; }