I have some confusion regarding the RTTI mechanism in C++.
Suppose in have class A and class B that inherits from A. Now consider the following code:
B* b = new B();
A* a = dynamic_cast<A*>(b);
I know that polymorphic classes with virtual methods have virtual tables and vptr's, but I thought that the pointers only give information about the virtual functions. How does the program know at runtime the type of b, using vptr's and vtables?