home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- From: nikki@trmphrst.demon.co.uk (Nikki Locke)
- Path: sparky!uunet!pipex!demon!trmphrst.demon.co.uk!nikki
- ReplyTo: nikki@trmphrst.demon.co.uk
- Subject: Re: help
- References: <1992Sep13.164046.24676@njitgw.njit.edu>
- Distribution: world
- X-Mailer: cppnews $Revision: 1.16 $
- Organization: Trumphurst Ltd.
- Lines: 32
- Date: Tue, 15 Sep 1992 11:27:18 +0000
- Message-ID: <716581638snx@trmphrst.demon.co.uk>
- Sender: usenet@gate.demon.co.uk
-
-
- In article <1992Sep13.164046.24676@njitgw.njit.edu> jxd7299@hertz.njit.edu (Jing X Ding) writes:
-
- >
- > PROD *A;//PROD is a defined class
- > :
- > :
- > for (...){
- > A=(PROD*)new char [totalprod*sizeof(PROD)];//totalprod is a const
- > :
- > :
- > Place 1
- > }
- > Place 2
- >
- > The problem is :(1) Where can I use destructure to free memory (Place 1 or
- > Place 2)? (2) How to write the destructure?
- That is an interesting corruption of the word "destructor" - meaningful,
- too !
-
- What you want is ...
- A = new PROD[totalprod];
- :
- :
- delete [] A;
-
- ---
- Nikki Locke | | nikki@trmphrst.demon.co.uk
- Trumphurst Ltd. | Tel: +44 (0)691-670318 | nikki@cix.compulink.co.uk
- PC and Unix consultancy | Fax: +44 (0)691-670316 | nikki@kewill.co.uk
- trmphrst.demon.co.uk is NOT affiliated with ANY other sites at demon.co.uk.
- Demon.co.uk is a dial-up subscription access point to the Internet.
-