what if I redefine a method of a base class and set it as "virtual" in a derived class in a chain of deriving actions?

like the title.

Is it legal? And what will it be?
The title doesn't make much sense. To "redefine" a method of the base class you have to change the implementation of that method.

If your answer is "How do I override a nonvirtual base class method?" the answer is "You don't." You can overload the function, which will hide the base class method of the same name when in the scope of the derived class, but you cannot override a function that is not virtual.

http://ideone.com/xM2VtW
Topic archived. No new replies allowed.