changeset 29 | 7abf6146898e |
parent 28 | 54addf5893ef |
child 77 | 49e0babccb23 |
--- a/bad_alloc.cc +++ b/bad_alloc.cc @@ -27,7 +27,9 @@ int main (int argc, char **argv) { vector < int >v; + int i = 0; + char action; if (set_limit (20 * 1024 * 1024)) { @@ -39,11 +41,12 @@ for (;;) { v.push_back (i++); } - } catch (exception & e) { + } + catch (exception & e) { cout << e.what () << " after " << i << " iterations" << endl << endl; cout << "Would you like to see the full error message? (y/n) "; cin >> action; - v.clear(); + v.clear (); switch (action) { case 'y': throw;