|
INTERVIEW QUESTIONS
C++
EXCEPTIONS IN C++
DETAILS
Question: what is Un handled exception(KERNEL32.DLL): 0xE06D7363 in the context of exception handling? pls answer to my mail id.in the flg code i got a problem.i want to know the entire steps followed in exception handling in this program.
#include <iostream> using namespace std; int main() { cout << "Start "; try { // start a try block cout << "Inside try block "; cout << "Still inside try block "; throw 78; } catch (double i) { // catch an error cout << "Caught an exception -- value is: "; cout << i << " "; } cout << "End"; return 0; }
Answer: Un-handled exceptions are those exception for which no catch explicitly mentioned in the programmer and to handle those exceptions, library function terminate()is to be called which calls abort() to stop the program. In the program mentioned, you are trying to throw an integer exception but, for catch, double is there. So no match found and un-handled exception situation arise for which terminate is being called which in turn calls the abort()function which stops your program.
|
|
|
Category |
Exceptions in C++ Interview Questions & Answers -
Exam Mode /
Learning Mode
|
Rating |
(0.3) By 8963 users |
Added on |
5/19/2013 |
Views |
70852 |
Rate it! |
|
|
Question:
what is Un handled exception(KERNEL32.DLL): 0xE06D7363 in the context of exception handling? pls answer to my mail id.in the flg code i got a problem.i want to know the entire steps followed in exception handling in this program.
#include <iostream> using namespace std; int main() { cout << "Start "; try { // start a try block cout << "Inside try block "; cout << "Still inside try block "; throw 78; } catch (double i) { // catch an error cout << "Caught an exception -- value is: "; cout << i << " "; } cout << "End"; return 0; }
Answer:
Un-handled exceptions are those exception for which no catch explicitly mentioned in the programmer and to handle those exceptions, library function terminate()is to be called which calls abort() to stop the program. In the program mentioned, you are trying to throw an integer exception but, for catch, double is there. So no match found and un-handled exception situation arise for which terminate is being called which in turn calls the abort()function which stops your program. Source: CoolInterview.com
Answered by: Naveen | Date: 6/30/2008
| Contact Naveen
If you have the better answer, then send it to us. We will display your answer after the approval.
Rules to Post Answers in CoolInterview.com:-
- There should not be any Spelling Mistakes.
- There should not be any Gramatical Errors.
- Answers must not contain any bad words.
- Answers should not be the repeat of same answer, already approved.
- Answer should be complete in itself.
|
|
Related Questions |
View Answer |
|
Can we generate a C++ source code from the binary file?
|
View Answer
|
|
what is the difference betwen wait() and delay()?
|
View Answer
|
|
How can I get around scope problems in a try/catch?
|
View Answer
|
Please Note: We keep on updating better answers to this site. In case you are looking for Jobs, Pls Click Here Vyoms.com - Best Freshers & Experienced Jobs Website.
View All Exceptions in C++ Interview Questions & Answers - Exam Mode /
Learning Mode
|