Quiz · Exceptions · lesson 3 of 9
Quiz — catch order
What does the program print?
#include <iostream>
struct Error {};
struct NotFound : public Error {};
int main() {
try { throw NotFound{}; }
catch (const Error&) { std::cout << "Error"; }
catch (const NotFound&) { std::cout << "NotFound"; }
}Subscribe to take the course
The course is free. Sign in with Telegram and subscribe to the channel to open every lesson.