What happens as a result of an attempt of dynamic_cast:
#include <iostream>
using namespace std;

class A{
public:
	virtual ~A() {}
};

class B: public A{ };

int main(){
	A * a = new A();
	try{
		B * b = dynamic_cast<B *>(a);
	}catch(...){		
	}	
	return 0;
}

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback
Cosmo
Sign Up Now
or Subscribe for future quizzes