Vidyalelo
C++ Programming · all questions

Exception Handling in C++
practice.

Practice every MCQ with options. Use Show answers when you want the correct option and solution.

68

Questions

2/4

Page

Pick an option on a question to see the right answer and solution.

What happens if an exception is thrown inside a 'catch' block in C++?

Select an option to see the answer and solution.

How do you re-throw the current exception in C++?

Select an option to see the answer and solution.

Which of the following statements about exception handling in C++ is correct?

Select an option to see the answer and solution.

What is the purpose of the 'std::exception_ptr' class in C++ exception handling?

Select an option to see the answer and solution.

How do you catch multiple exceptions of different types in C++?

Select an option to see the answer and solution.

Which keyword is used to define a custom exception class in C++?

Select an option to see the answer and solution.

What is the purpose of the 'std::terminate' function in C++?

Select an option to see the answer and solution.

What is the purpose of the 'nothrow' parameter in the 'new' operator in C++?

Select an option to see the answer and solution.

How do you handle exceptions thrown from constructor initialization lists in C++?

Select an option to see the answer and solution.

What is the purpose of the 'std::bad_function_call' class in C++ exception handling?

Select an option to see the answer and solution.

Which statement about the 'finally' block in C++ exception handling is true?

Select an option to see the answer and solution.

What is the purpose of the 'std::nested_exception' class in C++ exception handling?

Select an option to see the answer and solution.

How do you catch an exception by reference in C++?

Select an option to see the answer and solution.

What is the purpose of the 'std::logic_error' class in C++ exception handling?

Select an option to see the answer and solution.

What happens if an exception is thrown inside a destructor in C++?

Select an option to see the answer and solution.

Which keyword is used to specify that a function will not throw any exceptions in C++?

Select an option to see the answer and solution.

What is the purpose of the 'std::uncaught_exception' function in C++?

Select an option to see the answer and solution.

Which standard header file is required for exception handling in C++?

Select an option to see the answer and solution.

How do you specify that a function will throw no exceptions in C++?

Select an option to see the answer and solution.

What is the purpose of the 'std::exception_ptr::rethrow' function in C++?

Select an option to see the answer and solution.