|
Exceptions in C++ Interview Questions & Answers
Below we have listed all the Exceptions in C++ Interview Questions and answers. Feel free to comment on any Exceptions in C++ Interview Questions or answer by the comment feature available on the page.
To buy an eBook containing 30,000 Interview Questions, with Answers, Click Here.
View All Exceptions in C++ Interview Questions & Answers - Exam Mode /
Learning Mode
|
A C++ exception is a response to an exceptional circumstance that arises while a program is running, such as an attempt to divide by zero. Exceptions provide a way to transfer control from one part of a program to another. C++ exception handling is built upon three keywords: try, catch, and throw.
One of the advantages of C++ over C is Exception Handling. C++ provides following specialized keywords for this purpose. try: represents a block of code that can throw an exception. catch: represents a block of code that is executed when a particular exception is thrown. throw: Used to throw an exception.
|
|