try-catch statement
De cppreference.com
|
|
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
<metanoindex/>
Utilisé pour tenter l'exécution d'une instruction-composée, tandis que la capture et la gestion des exceptions qui peuvent avoir été lancées à la suite de cette tentative .
Original:
Used to attempt the execution of a compound-statement, while catching and handling exceptions that may have been thrown as a result of this attempt.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
Syntaxe
try { statements } catch ( exception-decl ) { statements }
|
(1) | ||||||||
try { statements } catch ( exception-decl-1 ) { statements } catch ( exception-decl-2 ) { statements }
|
(2) | ||||||||
try { statements } catch ( exception-decl ) { statements throw; }
|
(3) | ||||||||