class Security {
public:
virtual ~Security() {}
};
class Stock: public Security {};
class Bond: public Security {};
class Investment: public Security {
public:
void special()
{
cout << "Special Investment function" << endl;
}
};
class Metal: public Investment {};
int main()
{
Security* s = new Metal;
cout << typeid(s).name() << endl;
cout << typeid(*s).name() << endl;
}
OUTPUT:
P8Security
5Metal
Why it always introduces in front of the name,numbers ?