Question 1 of 25
Hints left: 3
Q1
What is the purpose of the 'nothrow' parameter in the 'new' operator in C++?
Q2
Which of the following is true about the 'noexcept' specifier in C++?
Q3
How do you specify that a function may throw an exception in C++?
Q4
What is the purpose of the 'std::bad_function_call' class in C++ exception handling?
Q5
What is the purpose of the 'std::bad_alloc' class in C++ exception handling?
Q6
Which standard header file is required for exception handling in C++?
Q7
How do you re-throw the current exception in C++?
Q8
Which keyword is used to specify that a function will not throw any exceptions in C++?
Q9
How do you specify that a function will throw no exceptions in C++?
Q10
How do you catch an exception by reference in C++?
Q11
What is the purpose of the 'std::nested_exception' class in C++ exception handling?
Q12
What is the default behavior of an uncaught exception in C++?
Q13
Which of the following statements about exception handling in C++ is correct?
Q14
What is the purpose of the 'std::runtime_error' class in C++ exception handling?
Q15
What is the purpose of the 'std::logic_error' class in C++ exception handling?
Q16
What happens if an exception is thrown inside a 'catch' block in C++?
Q17
Which statement about the 'finally' block in C++ exception handling is true?
Q18
What happens if an exception is thrown inside a destructor in C++?
Q19
What is the purpose of the 'std::uncaught_exception' function in C++?
Q20
What is the purpose of the 'std::exception_ptr' class in C++ exception handling?
Q21
How do you handle exceptions thrown from constructor initialization lists in C++?
Q22
How do you catch multiple exceptions of different types in C++?
Q23
Which keyword is used to define a custom exception class in C++?
Q24
How do you define your own exception class in C++?
Q25
What is the purpose of the 'std::terminate' function in C++?