下面的简单代码
// g++ centro.cc -o centro
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
try
{
cout << "Going to throw" << endl;
throw;
}
catch(...)
{
cout << "An exception occurred" << endl;
}
return 0;
}
产生中止:
Going to throw
terminate called without an active exception
Aborted (core dumped)
我不明白出了什么问题,有人能指出我正确的方向吗?