home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!mcsun!fuug!demos!kiae!glas!demos!maccs.dcss.mcmaster.ca!langtonk
- From: langtonk@maccs.dcss.mcmaster.ca
- Newsgroups: comp.lang.c++
- Date: 17 Jul 92 22:25 MDT
- Subject: help on dynamic multidim. array in
- Sender: Notesfile to Usenet Gateway <notes@glas.apc.org>
- Message-ID: <1992Jul17.182514.24651@maccs.dcs>
- Nf-ID: #N:1992Jul17.182514.24651@maccs.dcs:1510041107:001:714
- Nf-From: maccs.dcss.mcmaster.ca!langtonk Jul 17 22:25:00 1992
- Lines: 28
-
-
- I am trying to dynamically allocate a two dimensional array using
- the command "new" in Borland C++ version 2.0. The idea is that I want
- to be able to change the size of the array at any time within the
- program and I don't know the array size ahead of time. As an example
- I have tried the following:
-
- int *arr;
-
- arr = new int [10][5]
-
- This gives the following error message:
-
- Cannot assign 'int[5] far *' to 'int far *'
-
- The Borland C++ Programmers Guide has the following example of page 111:
-
- mat_ptr = new int [3][10][12]
-
- but it does not give the data type for mat_ptr. Does anyone know how to
- make this work? Any advice would be greatly appreciated.
-
- Many Thanks.
-
- Joseph Ho
-
- langtonk@maccs.dcss.mcmaster.ca
-
-