0 5

BIT153 ยท 0 ยท 5 marks

Write a program to handle "array index out of range" exception.

Write a program to handle "array index out of range" exception. [5]

Object Oriented ProgrammingChapter 10: Exception Handling and File I/OException handling definition and purpose

A raw array subscript in C++ is not checked. Writing numbers[10] on an array of five elements does not throw anything and does not report an error; it simply reads or writes memory that does not belong to the array, which is undefined behaviour. There is no equivalent of Java's ArrayIndexOutOfBou...