Limitations of Exception Handling in C++

The exception handling in C++ also have few limitations:

  • Exceptions may break the structure or flow of the code as multiple invisible exit points are created in the code which makes the code hard to read and debug.
  • If exception handling is not done properly can lead to resource leaks as well.
  • It’s hard to learn how to write Exception code that is safe.
  • There is no C++ standard on how to use exception handling, hence many variations in exception-handling practices exist.

Exception Handling in C++

In C++, exceptions are runtime anomalies or abnormal conditions that a program encounters during its execution. The process of handling these exceptions is called exception handling. Using the exception handling mechanism, the control from one part of the program where the exception occurred can be transferred to another part of the code.

So basically using exception handling in C++, we can handle the exceptions so that our program keeps running.

Similar Reads

What is a C++ Exception?

An exception is an unexpected problem that arises during the execution of a program our program terminates suddenly with some errors/issues. Exception occurs during the running of the program (runtime)....

C++ try and catch

C++ provides an inbuilt feature for Exception Handling. It can be done using the following specialized keywords: try, catch, and throw with each having a different purpose....

Why do we need Exception Handling in C++?

The following are the main advantages of exception handling over traditional error handling:...

Examples of Exception Handling in C++

The following examples demonstrate how to use a try-catch block to handle exceptions in C++....

Properties of Exception Handling in C++

...

Limitations of Exception Handling in C++

...

Conclusion

Property 1...