CPP
cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
//Credits: www.learncpp.com
#include <iostream>
void last() // called by third()
{
std::cout << "Start last\n";
std::cout << "last throwing int exception\n";
throw -1;
std::cout << "End last\n";
}
void third() // called by second()
{
std::cout << "Start third\n";
last();
std::cout << "End third\n";
}
void second() // called by first()
{
std::cout << "Start second\n";
try
{
third();
}
catch(double)
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run