codepad
[
create a new paste
]
login
|
about
Language:
C
C++
D
Haskell
Lua
OCaml
PHP
Perl
Plain Text
Python
Ruby
Scheme
Tcl
#include <exception> #include <cassert> #include <cstring> class user_exception: public std::exception { const char* what() const throw() { return "user exception"; } }; int main() { using namespace std; const exception& rhs = user_exception(); exception lhs = rhs; assert( strcmp(lhs.what(), rhs.what()) == 0 ); }
Private
[
?
]
Run code
Submit