home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!pipex!warwick!bham!bhamvx!mccauleyba
- From: mccauleyba@vax1.bham.ac.uk (Brian McCauley)
- Subject: Re: 'new' syntax?
- Sender: usenet@rs6000.bham.ac.uk (USENET News Service)
- Message-ID: <1992Nov13.124612.1@vax1.bham.ac.uk>
- Date: Fri, 13 Nov 1992 12:46:12 GMT
- Lines: 21
- References: <1992Nov13.095152.26819@rs6000.bham.ac.uk>
- Organization: University of Birmingham
-
- In article <1992Nov13.095152.26819@rs6000.bham.ac.uk>, pickerig@eee.bham.ac.uk (Mr. G. Pickering) writes:
- > I want to create an array of 'size' long**, is the correct syntax:
- >
- > long*** new_blocks = new (long**[size]);
- >
- > I am having memory corruption problems and suspect this is not doing
- > what I really want.
- I have trouble with the new operator myself I normally give up trying to
- understand the syntax and use a local typedef.
- {
- typedef long **longPtrPtr;
- longPtrPtr *new_blocks = new longPtrPtr[size];
- }
- Possibly not the most elegant solution but at least it works.
- --
- \\ ( ) No Bullshit! | Email: B.A.McCauley@bham.ac.uk
- . _\\__[oo from | Voice: +44 21 471 3789 (home)
- .__/ \\ /\@ /~) /[ /\/[ | Fax: +44 21 625 2175 (work)
- . l___\\ /~~) /~[ / [ | Snail: 197 Harborne Lane,
- # ll l\\ ~~~~ ~ ~ ~ ~ | Birmingham, B29 6SS, UK
- ###LL LL\\ (Brian McCauley) | ICBM: 52.5N 1.9W
-