Path: utzoo!attcan!uunet!husc6!rutgers!tut.cis.ohio-state.edu!osu-cis!att!ihlpa!vkar From: vkar@ihlpa.ATT.COM (Thayalan) Newsgroups: comp.lang.c++ Subject: Re: virtual functions Summary: You have to define for the base class Message-ID: <9420@ihlpa.ATT.COM> Date: 15 Sep 88 18:47:11 GMT References: <544*metz@iam.unibe.ch> Organization: AT&T Bell Laboratories - Naperville, Illinois Lines: 13 In article <544*metz@iam.unibe.ch>, metz@iam.unibe.ch (Igor Metz) writes: > ..... > If I rewrite the virtual declaration to > virtual void pprint() {}; // empty function body > everything works fine. Is this a bug in the book, or am I doing something > wrong? You must define the virtual function in the base class. This is exactly what you are doing to make it work correctly. The reference manual in Stroustrup's book clearly states this. See page 278 in the book(English language version). So therefore, the answer is, it's not a bug. K. Thayalan