/*
* exceptionclass.cpp
*
* Created on: 2014年10月31日
* Author: Administrator
*/
#include<iostream>
#include<exception>
#include<string>
using namespace std;
class MyException : public std::exception{
public:
const char * what() const throw(){
cout << "what()" << endl;
return "aaaaaaaaaaaa";
}
};
void test_exception(){
MyException me;
throw me;
}
int main(){
try{
test_exception();
}catch(const exception & e){
cout << e.what() << endl;
}
return 0;
}