Courses
Tutorials
Practice
Data Structure
Java
Python
HTML
Interview Preparation
DSA
Practice Problems
C
C++
Java
Python
JavaScript
Data Science
Machine Learning
Courses
Linux
DevOps
SQL
Web Development
System Design
Aptitude
GfG Premium
Similar Topics
Web Technologies
37.4K+ articles
Misc
8.8K+ articles
C++
4.3K+ articles
Difference Between
3.6K+ articles
C++ Programs
2.4K+ articles
School Programming
1.5K+ articles
Programming Language
594+ articles
C/C++ Puzzles
187+ articles
CPP-Basics
102+ articles
C++-Exception Handling
14+ articles
cpp-exception
15 posts
Recent Articles
Popular Articles
How to Use the Try and Catch Blocks in C++?
Last Updated: 21 April 2024
In C++, thetryandcatchblocks are used as a part of the exception handling mechanism which allows us to handle runtime errors. If the exceptions are not handled properly th...
read more
cpp-exception
Exception Handling
C++
C++-Exception Handling
C++ Programs
Picked
CPP Examples
How to Throw an Exception in C++?
Last Updated: 03 April 2024
In C++, exception handling is a mechanism that allows us to handle runtime errors and exceptions are objects that represent an error that occurs during the execution of a ...
read more
cpp-exception
C++
C++-Exception Handling
C++ Programs
Picked
CPP Examples
How to Throw and Catch Exceptions in C++?
Last Updated: 03 April 2024
In C++, exception handling is a mechanism that allows us to handle runtime errors and exceptions are unusual conditions that occur at runtime. In this article, we will lea...
read more
cpp-exception
C++
C++-Exception Handling
C++ Programs
Picked
CPP Examples
How to Catch All Exceptions in C++?
Last Updated: 18 March 2024
In C++, exceptions are objects that indicate you have an error in your program. They are handled by the try-catch block in C++. In this article, we will learn how to catch...
read more
cpp-exception
C++
C++ Programs
Picked
CPP Examples
How Do I Continue to the Next Iteration of a for Loop After an Exception is Thrown in C++?
Last Updated: 22 February 2024
In C++, when an exception is thrown, the normal flow of the program is disrupted and we need to take care of it. In this article, we will learn how can we continue to the ...
read more
cpp-exception
C++
C++-Exception Handling
C++ Programs
Picked
CPP Examples
How to Throw a Custom Exception in C++?
Last Updated: 08 February 2024
In C++, exception handling is done by throwing an exception in a try block and catching it in the catch block. We generally throw the built-in exceptions provided in the e...
read more
cpp-exception
Exception Handling
C++
C++-Exception Handling
C++ Programs
Picked
CPP Examples
How to Catch a Specific Exception in C++?
Last Updated: 08 February 2024
In C++, exceptions are runtime anomalies or abnormal conditions that a program encounters during its execution. The process of handling these exceptions is called exceptio...
read more
cpp-exception
C++
C++-Exception Handling
C++ Programs
Picked
C++ Errors
CPP Examples
How to Catch Floating Point Errors in C++?
Last Updated: 29 January 2024
In C++, a part of the code that may throw exceptions is enclosed in try-and-catch blocks to handle them when they arise. We can also use try...catch to catch floating poin...
read more
cpp-exception
Exception Handling
C++
C++-Exception Handling
C++ Programs
Picked
CPP Examples
Exception Handling using Classes in C++
Last Updated: 15 May 2025
In C++, unexpected issues may occur during program execution such as attempting to divide by zero, accessing a non-existent file or using invalid data. These issues are ca...
read more
CPP-Basics
cpp-exception
C++
C++-Exception Handling
C++ Programs
C/C++ Puzzles
Exception Header in C++ With Examples
Last Updated: 09 October 2022
C++ provides a list of standard exceptions defined in header exception in namespace std where "exception" is the base class for all standard exceptions. All exceptions lik...
read more
cpp-exception
Programming Language
C++
C++-Exception Handling
C++ Programs
Handling the Divide by Zero Exception in C++
Last Updated: 23 July 2024
We use Exception Handling to overcome exceptions occurred in execution of a program in a systematic manner.Dividing a number by Zero is a mathematical error (not defined) ...
read more
cpp-exception
C++
Customizing termination behavior for uncaught exception In C++
Last Updated: 15 April 2018
Whenever an exception arises in C++, it is handled as per the behavior defined using the try-catch block. However, there is often the case when an exception is thrown but ...
read more
cpp-exception
C++
bad_alloc in C++
Last Updated: 27 February 2018
Prerequisite : Exceptions in C++Standard C++ contains several built-in exception classes. The most commonly used is bad_alloc, which is thrown if an error occurs when atte...
read more
cpp-exception
C++
Exception Handling in C++
Last Updated: 15 May 2025
In C++, exceptions are unexpected problems or errors that occur while a program is running. For example, in a program that divides two numbers, dividing a number by 0 is a...
read more
cpp-exception
C Language
C++
School Programming
Comparison of Exception Handling in C++ and Java
Last Updated: 10 November 2022
Both languages use to try, catch and throw keywords for exception handling, and their meaning is also the same in both languages.Following are the differences between Java...
read more
Java
cpp-exception
Java-Exceptions
C++
Difference Between
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our
Cookie Policy
&
Privacy Policy
Got It !