Calling Base-Class functions
Posted on 1999-06-29
I'm working on an app that goes OO naturally, due to the hierarchical nature of the data. What I'm having a problem with is where to stick some of the code. I have an abstract base class (call it A) that B and C inherit from. What I'd like to do is have code in A that is shared by both B and C. I currently have a "display" function in B and C that share a pretty big chunk of initialization code. What seems natural to me is to have a virtual "display" in A that does this setup, then call that from B and C before running their own code. Is this possible? Is there a better way? Do I have to call the function something different in A?