C++ type information
===

I am moving to cpp from java, and I have a little problem understanding how some cpp features work. When we use polymorphism or type-safe casting, cpp needs to know the exact type of the object. In java, every object had a link to its defining class and so this information could be retrieved. But in cpp that's not the case (I think), I'm saying that because the sizeof() operator returns no more than what the object fields occupy and thus I'm guessing that's not where the type information is stored.
Am I mistaken here? If no then how does cpp manage polymorphism and stuff?