codepad
[
create a new paste
]
login
|
about
Language:
C
C++
D
Haskell
Lua
OCaml
PHP
Perl
Plain Text
Python
Ruby
Scheme
Tcl
#include <iostream> #include <string> using namespace std; string func(int choise){ try{ if( choise == 1 ) throw "some throw"; else if( choise == 2 ) return "try return"; } catch(const char * msg){ return msg; } return "normal return"; } int main(){ cout<<func(0)<<endl; cout<<func(1)<<endl; cout<<func(2)<<endl; return 0; }
Private
[
?
]
Run code
Submit