home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!dtix!darwin.sura.net!spool.mu.edu!agate!ucbvax!ucdavis!dionne!wagner
- From: wagner@ike.ucdavis.edu (John Wagner)
- Newsgroups: comp.lang.c++
- Subject: new array w/ initializers...
- Message-ID: <16945@ucdavis.ucdavis.edu>
- Date: 11 Sep 92 03:40:12 GMT
- Sender: usenet@ucdavis.ucdavis.edu
- Reply-To: wagner@ike.ucdavis.edu
- Organization: University of California, Davis
- Lines: 36
-
- something like the following:
-
- class Vector {
- private:
- double *vals;
- int dim;
- public:
- Vector (int dimension) {
- etc...
- }
- ...
- }; // End Class Vector
-
- main () {
- Vector *vecs;
- vecs = new Vector[10] (3);
- }
-
- The intent is to create an array of Vectors of dimension 3.
- I have run into this problem over and over again, and I don't
- see any logical reason for this not being possible (except
- possibly oversight). Surely others have had this same idea.
-
- ---
- John Wagner
- Institute of Theoretical Dynamics
- University of California, Davis
-
- Bush/Quayle 1992: Saddam has a job, do you?
-
- My opinions aren't even mine, much less those of anyone else...
- +------------------------------------+----------------------------+
- | jmwagner@ucdavis.edu | Wenn Du meinen Quelltext |
- | jmwagner@ucdavis | verstehen kannst, bist Du |
- | {ucbvax, lll-crg}!ucdavis!jmwagner | mir einen Schritt voraus! |
- +------------------------------------+----------------------------+
-