|
-
May 3rd, 2010, 08:43 AM
#1
virtual method question
Hello,
Does a method need to be virtual to be over-ridden in a subclass? For example:
class A
{
public:
A();
~A();
virtual void DoSomething();
}
class B : public A
{
public:
B();
~B();
void DoSomething();
}
Do I have to have the "virtual" keyword in there? What benefit does it provide if it is not a pure virtual method?
Thanks!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|