Forgot to enable RTTI. Thanks...
ignore post
Forgot to enable RTTI. Thanks...
ignore post
Last edited by JeremyCAFE; 02-13-2006 at 07:50 PM.
Why don't you just scan the page from your homework book and we can see the whole thing and maybe do the next question for you, too.
Sent from my iPadŽ
Or we can be rude and be of no help. thanks ass.
Yes, I am working on a lab. If you read I didnt ask for someone to do it for me. The lab has to do with getting user input for derived classes and store them into a base class pointer. I have already done that, im trying to take it further to figure out how somet things work. I asked what is going on so i can understand how to use dynamic_cast better.
where do I enable RTTI? That is probably where my problem is.
dynamic_cast is used as follows:
generally, dynamic_cast should be avoided. there are almost always better ways of doing the same thing (virtual functions, etc)Code:class base { }; class derived : public base { }; void func(base& b) { derived* pd = dynamic_cast<derived*>(&b); if (pd) { cout << "it's a derived class!"; } }
"I saw a sign that said 'Drink Canada Dry', so I started"
-- Brendan Behan
Free Compiler: Visual C++ 2005 Express
If you program in C++, you need Boost. You should also know how to use the Standard Library (STL). Want to make games? After reading this, I don't like WxWidgets anymore. Want to add some scripting to your App?