Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!samsung!munnari.oz.au!bruce!trlluna!trlamct!mcf From: mcf@trlamct.trl.oz.au (Michael Flower) Newsgroups: comp.lang.c++ Subject: Re: Virtual function problem. and apology Message-ID: <3475@trlluna.trl.oz> Date: 10 May 91 00:42:00 GMT References: <718@taumet.com> Sender: news@trlluna.trl.oz Lines: 43 In article mcf@tardis.trl.OZ.AU (Michael Flower) I wrote: The code class A { virtual void fn(char); // 1 virtual void fn(char *); // 2 }; class B : public A { void fn(int); }; produces the error "t.c", line 7: warning: B::fn() hides virtual A::fn() "t.c", line 7: warning: B::fn() hides virtual A::fn() Well, in fact it does, but the real problem I have is slightly different. I am guilty of making a mistake in my posting, and not checking it thoroughly. class B should read class B : public A { void fn(char *); } NB. I really was trying to redefine A::fn(). Thank you for your previous replies however, I have learned quite a lot from mistaken problem, which has really some quite interesting properties. I will have to give more thought to parameter conversions, along with the replies I got, I should really learn something here. The problem I had was that I was really trying to redefine A::fn(char*), and the warnings I got made me suspicious that I hadn't really managed it. Eventually when I tried changing lines 1 and 2 in class A, the problem went away. Michael Flower Artificial Intelligence Systems Email: m.flower@trl.oz.au Telecom Research Laboratories Voice: +61 3 541 6179 Melbourne, AUSTRALIA Fax: +61 3 543 8863