I have declared a function as virtual in base class. In derived class I am overriding the same function. According to me function in derived class should have been executed when I make a call to the function. But the base class function is executed.

Does anyone knows why this is happening?

Thanks in Advance

Recommended Answers

All 2 Replies

are you sure you're actually overriding it and not overloading?
Check your source, especially argument lists.
And check your spelling, a typo in the name of the function that was supposed to override the one in the base is easy to make and the compiler won't catch it.

Thank you very much.
As you said there was a mistake in Arguement list.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.