Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!pasteur!helios.ee.lbl.gov!ux3.lbl.gov!beard From: beard@ux3.lbl.gov (Patrick C Beard) Newsgroups: comp.lang.c++ Subject: Re: virtual vs. non-virtual functions. Message-ID: <2061@helios.ee.lbl.gov> Date: 9 Mar 89 18:37:26 GMT References: <201@ncr-fc.FtCollins.NCR.COM> Sender: usenet@helios.ee.lbl.gov Reply-To: beard@ux3.lbl.gov (Patrick C Beard) Distribution: na Organization: Lawrence Berkeley Laboratory, Berkeley Lines: 14 I am under the impression that the virtual keyword implies that a function is redefinable in a derived class. A non-virtual function isn't, and so is callable from derived classes. It would have worked as well if you had declared "Value" as virtual, and you would have been able to define a new version of Value() for the derived class D. Correct me if I'm wrong, I'm fairly new to C++ as well. +----------------------------------------------------------------+ \ Patrick Beard "Badges? \ \ Berkeley Systems, Inc. I ain't got to show you... \ \ PCBeard@lbl.gov ...NO STINKING BADGES!" \ + ---------------------------------------------------------------+