Goldman Sachs interview question

what's the difference between dynamic_cast, static_cast

Interview Answers

Anonymous

24 Feb 2010

I'm not a c++ person, so had to guess

Anonymous

20 May 2010

Casting is a mechanism by which a programmer can change the interpretation of an object by the compiler. A static cast and dynamic cast both convert pointers between related types by performing a check to make sure that a pointer is being converted to a related type. However, the difference is that the static cast performs the check during compilation while the dynamic cast performs the check using runtime type identification (RTTI).

Glassdoor | Glassdoor