求大神, c++的問題
拋出異常
void test()
{
throw IndexException();
}
int main(void)
{
try
{
test();
}
catch (Exception &e)
{
e.printException();
}
system("pause");
return 0;
}
拋出的是一個函數(shù),還是啥東西 怎么能當(dāng)對象用
拋出異常
void test()
{
throw IndexException();
}
int main(void)
{
try
{
test();
}
catch (Exception &e)
{
e.printException();
}
system("pause");
return 0;
}
拋出的是一個函數(shù),還是啥東西 怎么能當(dāng)對象用
2017-03-24
舉報
2017-03-26
IndexException()構(gòu)造了一個IndexException的對象,這是一個繼承了Exception類的子類。