Use app×
QUIZARD
QUIZARD
JEE MAIN 2026 Crash Course
NEET 2026 Crash Course
CLASS 12 FOUNDATION COURSE
CLASS 10 FOUNDATION COURSE
CLASS 9 FOUNDATION COURSE
CLASS 8 FOUNDATION COURSE
0 votes
333 views
in Programming by (72.8k points)
closed by
In C++, which of the following methods contained in the exception handling mechanism in a program fails to find a matching catch block for a raised exception?
1. unexpected()
2. terminate()
3. null()
4. default()

1 Answer

0 votes
by (121k points)
selected by
 
Best answer
Correct Answer - Option 1 : unexpected()

std::unexpected() is called by the C++ runtime when a dynamic exception specification is violated: an exception is thrown from a function whose exception specification forbids exceptions of this type. std::unexpected() may also be called directly from the program.

The terminate() function calls the function pointed to by terminate_handler . By default, terminate_handler points to the function abort() , which exits from the program. You can replace the default value of terminate_handler with the function set_terminate() 

To  assign the pointer NULL to a pointer variable in case you do not have exact address to be assigned. This is done at the time of variable declaration. A pointer that is assigned NULL is called a null pointer.

Default Arguments in C++ A default argument is a value provided in a function declaration that is automatically assigned by the compiler if the caller of the function doesn't provide a value for the argument with a default value. 

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

Categories

...