Article ID: 151168
Article Last Modified on 11/18/2003
/* Compile options needed: /c /GX */
class Exception //abstract class
{
/* Compile options needed: /c /GX
*/
class Exception //abstract class
{
int m_nCause;
char * m_pszMsg;
public:
Exception();
Exception( int, const char * = 0);
Exception( const Exception &);
~Exception();
inline virtual int Cause() = 0; //pure virtual function
inline virtual const char * Msg() = 0; //pure virtual function
};
int Exception::Cause()
{
return m_nCause;
}
const char * Exception::Msg()
{
return m_pszMsg;
}
void main()
{
try
{
int r = Exception(55,"no error").Cause(); //should be an
ERROR
throw Exception(-1,"error"); //should be an
ERROR
}
catch (Exception&e)
{
}
}
Additional query words: 4.00
Keywords: kbbug kbfix kblangcpp kbcpponly kbcompiler KB151168