What is an exception?

All QuestionsCategory: Cpp LanguageWhat is an exception?
Chetan Shidling asked 5 years ago

I need short information.

1 Answers
chetan shidling answered 5 years ago

An exception is an occurrence of an undesirable situation that can be detected during the execution of the program. When an exception occurs the program will be terminated abnormally.
Example of exception:
01. Divide by zero is an exception
02. Trying to open a file that does not exist is an exception.
03. Accessing the array elements with negative index values is an exception.