+ 8
Exception Handling => Handling (Managing) Exceptions (Errors) in your code.
Exceptions crash your program.
int a;
a = 1 / 0;
cout << a;
=> Crashes the program (Division by 0 Error)
try
{
int a;
a = 1 / 0;
cout << a;
}
catch(Exception e)
{
cout << "Division by 0 Error";
}
=> Program doesn't crash. It prints "Division by 0 Error" instead. Thus, exception is handled.



