[ create a new paste ] login | about

Link: http://codepad.org/Tatd1iHD    [ raw code | output | fork ]

C++, pasted on Feb 11:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include<iostream>
#include<stdexcept>
using namespace std;

int main()
{
    try
    {
        throw out_of_range("hello kitty");
    }
    catch(const out_of_range& le)
    {
        cout << le.what() << endl;
    }
    catch(...)
    {
        cout << "error" << endl;
    }

    int stop = 0;
}


Output:
1
hello kitty


Create a new paste based on this one


Comments: