home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.amiga.programmer
- Path: news.duc.auburn.edu!usenet
- From: beckwwp@unconfigured.xvnews.domain (Wendell P. Beckwith)
- Subject: Re: C++ Classes
- Message-ID: <DpysnI.Ctq@mail.auburn.edu>
- Sender: usenet@mail.auburn.edu (Usenet Administrator)
- Nntp-Posting-Host: wartan.eng.auburn.edu
- Reply-To: beckwwp@unconfigured.xvnews.domain
- Organization: The unconfigured xvnews people
- References: <Stewart_Menday.3jrp@kumear.DIALix.oz.au>
- Date: Tue, 16 Apr 1996 17:02:05 GMT
-
- In article <Stewart_Menday.3jrp@kumear.DIALix.oz.au>, Stewart_Menday@kumear.DIALix.oz.au (Stewart Menday) writes:
- >Hi ALL
- > I have a question about C++ and calling functions which have been
- >overriden.
- >
- >If I have a class x say and it is derived from class y say and they both a
- >method print() say. How do I call class y print from within class x?
- >
- >e.g.
- >
- >y.h
- >
- >class y{
- >public:
- > void print();
- > \
- > /
- > \
- > /
- >
- >}
- >
- >x.h
- >
- >class x:public y{
- >public:
- > void print();
- > \
- > /
- > \
- > /
- >}
- >
- >x.cc
- >
- >void x::print();
- >{
- > //some stuff for x
- >
- > //I wish to call y.print
- >}
- >
- >Any help would be great.
- >
- >
- >Stew
- >
- >-- Via DLG Pro v1.1
- >
-
- You would call it this way:
-
- void x::print() {
- y::print();
- }
-
-
-