Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Declaration?

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Does anyone know why I need to declare a pure virtual function twice?

What I mean is I already declared the pure virtual function on the base class in the *.h file. Now why do i need to declare it again in the derived class? It seems to be redundant since the declaration are suppose to inherit from the base class, isn't it?

Manure
 
I'm not sure if that's the anwer to ur question.

if u have a pure virtual function, in the child class, u need to declare it again withouth the =0; and also give it a definition!

again, it's been a while since I last played with abstract classes, so i might be wrong. just a suggestion.
:)
Avendeval


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top