home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 7405 < prev    next >
Encoding:
Text File  |  1996-08-05  |  859 b   |  58 lines

  1. Path: brushtail.hna.com.au!kumear!Stewart_Menday
  2. From: Stewart_Menday@kumear.DIALix.oz.au (Stewart Menday)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: C++ Classes
  5. Distribution: world
  6. Message-ID: <Stewart_Menday.3jrp@kumear.DIALix.oz.au>
  7. Date: 14 Apr 96 15:46:29 EST
  8. Organization: The DUNGEON BBS, Newcastle, Australia.
  9.  
  10. Hi ALL
  11.      I have a question about C++ and calling functions which have been
  12. overriden.
  13.  
  14. If I have a class x say and it is derived from class y say and they both a
  15. method print() say.  How do I call class y print from within class x?
  16.  
  17. e.g.
  18.  
  19. y.h
  20.  
  21. class y{
  22. public:
  23.      void print();
  24.      \
  25.      /
  26.      \
  27.      /
  28.  
  29. }
  30.  
  31. x.h
  32.  
  33. class x:public y{
  34. public:
  35.      void print();   
  36.      \
  37.      /
  38.      \
  39.      /
  40. }
  41.  
  42. x.cc
  43.  
  44. void x::print();
  45. {
  46.      //some stuff for x
  47.  
  48.      //I wish to call y.print
  49. }
  50.  
  51. Any help would be great.
  52.  
  53.  
  54. Stew
  55.  
  56. -- Via DLG Pro v1.1
  57.  
  58.