home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!gatech!prism!federation!andy
- From: andy@federation.gatech.edu (Andy Register)
- Newsgroups: comp.lang.c++
- Subject: Re: Using delete with arrays - help please!
- Message-ID: <74955@hydra.gatech.EDU>
- Date: 16 Nov 92 14:29:14 GMT
- References: <1992Nov16.023852.24205@gopher.dosli.govt.nz>
- Sender: news@prism.gatech.EDU
- Organization: CERL-EE, Georgia Institue of Technology
- Lines: 20
-
- When I experiment with this kind of thing, I use
- the function
-
- unsigned long coreleft()
-
- from the alloc.h file.
-
- I can call coreleft, new, delete, coreleft and if the
- results of the two coreleft calls are not the same
- then somewhere memory did not get free'd up. Admittidly
- not very sophisticated but it seems to work for me.
-
- Try it with the char * example you cited and see what happens.
- Also try it with you example and you will see why the [] is
- required in the delete.
-
- Any other strategies?
-
- Toodles
- Andy
-