What is try block in exception handling in Cpp?

All QuestionsCategory: Cpp LanguageWhat is try block in exception handling in Cpp?
Chetan Shidling asked 5 years ago

I need short information.

2 Answers
chetan shidling answered 5 years ago

The statements that generate an exception such as “divide by zero” are placed in a try block.
If an exception occurs, it throws an exception such as “divide by zero”.
This block also contains the statements that should not be executed if an exception occurs.

chetan shidling answered 5 years ago
  1. The statements that generate an exception such as “divide by zero” are placed in a try block.
  2. If an exception occurs, it throws an exception such as “divide by zero”.
  3. This block also contains the statements that should not be executed if an exception occurs.