Dynamic Cast

This is one of the type casting provided by C++. Let us understand with the help of an example. #include <iostream>using namespace std;#define MAX_LENGTH 50class person { unsigned int m_age; char m_name[MAX_LENGTH];public: person(unsigned int age, char* name) { m_age = age;    int len = strlen(name); strncpy(m_name, name, len); m_name[len+1] = ‘\0’; } virtual ~person(){}};class student : public person { unsigned int m_rollNumber;public: student(unsigned int age, char* name, unsigned int rollNumber):person(age, name),m_rollNumber(rollNumber) { } ~student(){}};class teacher: public person {unsigned int m_salary;public: teacher(unsigned int age, char* name, unsigned int salary):person(age, name),m_salary(salary) {…