Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
string bs("01234567");
try {
  string bs("01234567");
  size_t i = f();

  bs[i] = '\0';
}
catch (...) {
  cerr << "Index out of range" << endl;
}

...

Code Block
string bs("01234567");
for (int i=0; i<100i < 100; i++) {
  bs[i] = '\0';
}

This program does not typically raise an exception and is likely to crash.

...