Exception Handling C++
Kenny Yip Coding Kenny Yip Coding
33.1K subscribers
209 views
14

 Published On Aug 28, 2024

C++ Exception Handling. An exception is an error or problem that arises during the execution of a program. Sometimes this will cause the program to stop running. We can catch and handle exceptions so that our program can continue running even after encountering the issue.

When handling exceptions, we use three keywords:

try: run code inside this block in case of errors
throw: throws an exception when a problem is detected
catch: catch an exception thrown from try block and run code inside this block

If you need to review these topics:
Vectors:    • C++ Vectors and Dynamic Arrays  
Functions:    • C++ Functions  

C++ Playlist:
   • C++ Programming Tutorial  

Install C++ with VS Code:
   • How to set up C++ in Visual Studio Code  

Subscribe for more coding tutorials 😄!

show more

Share/Embed