Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!dciem!nrcaer!cognos!geovision!alastair From: alastair@geovision.UUCP (Alastair Mayer) Newsgroups: comp.lang.c++ Subject: Re: another probably dumb question Message-ID: <145@geovision.UUCP> Date: Fri, 14-Aug-87 11:25:17 EDT Article-I.D.: geovisio.145 Posted: Fri Aug 14 11:25:17 1987 Date-Received: Sun, 16-Aug-87 08:53:43 EDT References: <10148@orchid.waterloo.edu> Reply-To: alastair@geovision.UUCP (Alastair Mayer) Distribution: comp Organization: Geovision Corporation, Ottawa, Canada Lines: 27 In article <10148@orchid.waterloo.edu> gamiddleton@orchid.waterloo.edu (Guy Middleton) writes: > >I seem to have a problem with destructors. In this code here: > [..small program..] >... the constructor for the string class is called one more time than the >destructor. If I change it to read: > [..slightly reorganized program..] >then they get called the same number of times. I realise I probably >haven't provided enough information here, but I didn't want to post a huge >message. Does anybody have any idea what might be going on? >__ > -Guy Middleton, University of Waterloo Institute for Computer Research I have some suspicions, but nothing concrete enough to put forward without trying it myself. I think I need more info. (Could it have something to do with that cast of NULL to string?) However, as a general comment on trying to figure out just what is going on when wierd things start happening with my C++ code, I often find it helpful to look at the C code that cfront is generating ( -F option). Once you make your way past what it does to identifiers and inline code, you can sometimes (not always!) figure out why it's doing whatever it did. -- Alastair JW Mayer BIX: al UUCP: ...!utzoo!dciem!nrcaer!cognos!geovision!alastair Let's build a base on the Moon on our way to the asteroids - forget Mars.