Q:

How to handle the exception in C++?

0

How to handle the exception in C++?

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

Answer:

An exception is a problem that arises during the execution of a program. One of the advantages of C++ over C is Exception Handling.

C++ provides the following specialized keywords to handle the exception,

try:  A try represents a block of code that can throw an exception.

catch: A catch represents a block of code that is executed when a particular exception is thrown.

throw:The throw keyword is used to throw an exception. Also used to list the exceptions that a function throws, but doesn’t handle itself.

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

C++ Interview Questions For Experienced

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now
What is a Memory Leak?... >>
<< What is the “mutable” keyword in C++?...