#include <iostream>
using namespace std;
struct A
{
virtual void foo() { }
};
struct B1 :A
{
};
int main()
{
int x = 42;
A *a = (A*)&x;
try
{
B1 *b = dynamic_cast<B1*>(a);
}
catch (...)
{
cout << "what kind of exception is here now?";
}
return 0;
}
What type of exception I catch?
What else can I write inside parentheses: catch (...) to catch this exception as well?