|
@@ -230,10 +230,11 @@ public:
|
|
};
|
|
};
|
|
|
|
|
|
//异常类
|
|
//异常类
|
|
-class myException :public exception //自己的异常类继承标准库中的异常类
|
|
|
|
|
|
+class myException :public logic_error //自己的异常类继承标准库中的异常类
|
|
{
|
|
{
|
|
public: //父类中为char*类型,把string转换为char*
|
|
public: //父类中为char*类型,把string转换为char*
|
|
- myException(string str) :exception(str.c_str()) {}
|
|
|
|
|
|
+ myException(const string &str) :logic_error(str) {}
|
|
|
|
+ virtual ~myException() throw(){}
|
|
};
|
|
};
|
|
|
|
|
|
#endif // DISPLAY_STRUCT_H
|
|
#endif // DISPLAY_STRUCT_H
|