home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!boulder!thicks
- From: thicks@fred.Colorado.EDU (Tom Hicks)
- Subject: derived class destructors
- Message-ID: <1992Jul24.162930.9111@colorado.edu>
- Originator: thicks@fred
- Keywords: destructors, derived class
- Sender: news@colorado.edu (The Daily Planet)
- Nntp-Posting-Host: fred.colorado.edu
- Organization: University of Colorado Boulder, OCS
- Distribution: usa
- Date: Fri, 24 Jul 1992 16:29:30 GMT
- Lines: 25
-
- Hi -
-
- I am having a problem with a destructors, and I can't find any
- examples of how to use destructors with derived classes. I have three classes,
- X, Y and Z, such that:
-
- class Z: public X, public Y { // etc. };
-
- I have destructors for classes X and Y, and when I call the destructor for
- Z, I want to also call the X and Y destructors. I am trying to use
-
- Z::~Z() : ~X() , ~Y() { // etc. }
-
- but the compiler keeps giving me a syntax error. I know that this is the
- correct syntax for constructors, but is this the proper syntax for destructors?
- I have searched Stroustrup's "The C++ Programming Language", but could not
- find any useful help on this subject.
-
- Please e-mail responses. Any help/pointers appreciated.
-
- -------------------------------------------------------------------------
- Tom Hicks
- thicks@fred.colorado.edu Optoelectronic Computing
- (303) 492 - 2769 Systems Center, CU-CSU
- --------------------------------------------------------------------------
-