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

1/4

Page

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

What is exception handling in C++?

Select an option to see the answer and solution.

Which keyword is used to throw an exception in C++?

Select an option to see the answer and solution.

What is the purpose of the 'try' block in exception handling in C++?

Select an option to see the answer and solution.

Which of the following is not a standard exception class in C++?

Select an option to see the answer and solution.

What is the purpose of the 'catch' block in exception handling in C++?

Select an option to see the answer and solution.

Which of the following is not a part of the exception handling mechanism in C++?

Select an option to see the answer and solution.

What does the 'std::exception' class represent in C++ exception handling?

Select an option to see the answer and solution.

How do you catch all exceptions in C++?

Select an option to see the answer and solution.

Which function is used to retrieve the description of the exception in C++?

Select an option to see the answer and solution.

What happens if an exception is thrown but not caught in C++?

Select an option to see the answer and solution.

Which of the following statements is true about the 'finally' block in C++ exception handling?

Select an option to see the answer and solution.

What is the purpose of re-throwing an exception in C++?

Select an option to see the answer and solution.

Which header file is necessary for exception handling in C++?

Select an option to see the answer and solution.

What is the function of the 'assert' macro in C++?

Select an option to see the answer and solution.

How do you define your own exception class in C++?

Select an option to see the answer and solution.

What is the default behavior of an uncaught exception in C++?

Select an option to see the answer and solution.

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

Select an option to see the answer and solution.

How do you specify that a function may throw an exception in C++?

Select an option to see the answer and solution.

Which of the following is true about the 'noexcept' specifier in C++?

Select an option to see the answer and solution.

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

Select an option to see the answer and solution.