// 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)
我不明白什麼是錯的,任何人可以點我在正確的方向?