2081 6

Object Oriented Programming20815 marksException handling definition and purpose

Why do we need to handle exception? Illustrate with an example.

Why do we need to handle exception? Illustrate with an example. [5]

An exception is an abnormal event detected while a program is running, such as a file that will not open, a request for memory that cannot be met, or an argument that makes an operation meaningless. In C++ the code that detects the trouble signals it with throw, and the code that knows what to do...

Up nextHow do you return object in function? Describe with an example.