how to know the correct class of objects cpp

C++
TYPE& dynamic_cast<TYPE&> (object);
TYPE* dynamic_cast<TYPE*> (object);
Source

Also in C++: