Tutorials
Courses
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
36.8K+ articles
Misc
8.4K+ articles
C++
4.3K+ articles
Difference Between
3.4K+ articles
C++ Programs
2.1K+ articles
Programming Language
525+ articles
C/C++ Puzzles
154+ articles
CPP-Basics
102+ articles
Java-Exceptions
84+ articles
C++-Exception Handling
14+ articles
cpp-exception
15 posts
Recent Articles
Popular Articles
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
Misc
C++
cpp-exception
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
C++
cpp-exception
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
C++
cpp-exception
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
C++ Programs
Programming Language
C++
cpp-exception
C++-Exception Handling
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
C/C++ Puzzles
C++ Programs
C++
CPP-Basics
cpp-exception
C++-Exception Handling
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
Difference Between
C++
cpp-exception
Java-Exceptions
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
C++
cpp-exception
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
C++ Programs
C++
Picked
cpp-exception
Exception Handling
C++-Exception Handling
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
C++ Programs
C++
Picked
cpp-exception
C++-Exception Handling
CPP Examples
How to Throw a Custom Exception in C++?
Last Updated: 02 June 2025
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
C++ Programs
C++
Picked
cpp-exception
Exception Handling
C++-Exception Handling
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
C++ Programs
C++
Picked
cpp-exception
C++-Exception Handling
C++ Errors
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
C++ Programs
C++
Picked
cpp-exception
C++-Exception Handling
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
C++ Programs
C++
Picked
cpp-exception
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
C++ Programs
C++
Picked
cpp-exception
C++-Exception Handling
CPP Examples
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
C++ Programs
C++
Picked
cpp-exception
Exception Handling
C++-Exception Handling
CPP Examples
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 !