What is really the difference between dynamic and static cast?
Code ex:
float number=43.54;
cout << static_cast<int>(number) << endl;
cout << dynamic_cast<int>(number) << endl;
The compiler (Borland Builder 5) flags an error when I use the dynamic cast (cannot cast from 'float' to 'int'), but if I use static cast - everything works perfectly.
Why this?
Thanks
Xagiber