Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
C++
dynamic_cast for down casting from base to concrete type
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
Reply to thread
Message
[QUOTE="Greg, post: 2584721"] Actually, I had the direction of the cast reversed. The corrected example would be:: struct A {}; struct B : virtual A {} int main() { A *a = new B; B * b = static_cast<B*>(a); // undefined } If A were an ordinary base class of B then the static_cast would be OK. Greg [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
C++
dynamic_cast for down casting from base to concrete type
Top