?? cppsafedivide.h
字號:
//
// FILE: CppSafeDivide.h
//
// Copyright (c) 1997 by Aaron Michael Cohen and Mike Woodring
//
/////////////////////////////////////////////////////////////////////////
#ifndef __CppSafeDivide__
#define __CppSafeDivide__
// CWin32Exception
//
// A C++ object that is thrown in response to a Win32 exception
// and that can be caught C++ style.
//
class CWin32Exception
{
public:
CWin32Exception( unsigned int ExceptionCode )
: m_ExceptionCode(ExceptionCode)
{
}
unsigned int GetCode( void )
{
return(m_ExceptionCode);
}
virtual char *GetText( void )
{
return("unhandled exception");
}
private:
unsigned int m_ExceptionCode;
};
// CIntDivideByZero
//
// A derivation of CWin32Exception that overrides the
// GetText virtual function to announce that a divide
// by zero exception occurred.
//
class CIntDivideByZero : public CWin32Exception
{
public:
CIntDivideByZero( unsigned int ExceptionCode )
: CWin32Exception(ExceptionCode)
{
}
virtual char *GetText( void )
{
return("divide by zero");
}
};
#endif // __CppSafeDivide__
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -