From -1159043391140164617
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,e191db47f821e732,start
X-Google-Attributes: gidf78e5,public
From: Peter Kelm <kelm@lise.physik.TU-Berlin.DE>
Subject: multidemensional array using stl vector
Date: 1997/06/30
Message-ID: <Pine.GSO.3.96.970630204810.3711A-100000@lise.physik.TU-Berlin.DE>#1/1
X-Deja-AN: 253681356
X-Original-Date: Mon, 30 Jun 1997 20:54:00 +0200
Organization: -
X-Access: 16 916
X-Auth: PGPMoose V1.1 PGP comp.std.c++ iQBFAgUBM7gJ0uEDnX0m9pzZAQHAlwF/TKHpMK46MBCgWvwjpoiOjJgq/lPhhYmS OOA0ZIMLdp7WWc6LR8JWtUdAWy3OSQu4 =11j4
Newsgroups: comp.std.c++
Nntp-Posting-User: L0iqmT6Hm9Wss
Originator: fjh@murlibobo.cs.mu.OZ.AU


hi,

I want to create a two-dimensional array using stl vector
size is determined at runtime. But how do I do this?

#include <vector>

typedef vector<double> row;
typedef vector<row*>   matrix;
matrix myMatrix;

the code above works but if I do it like this i cannot use
the "common" subscript operator

myMatrix[1][2] = 5.4;

Ideas for a simple solution?

Thanks                Peter

         --- beam me up Scotty, this planet sucks ---                      
                                                        Plan B
Peter Kelm (kelm@physik.tu-berlin.de)

Technical University Berlin
Physics Department
---
[ comp.std.c++ is moderated.  To submit articles: try just posting with      ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu         ]
[ FAQ:      http://reality.sgi.com/employees/austern_mti/std-c++/faq.html    ]
[ Policy:   http://reality.sgi.com/employees/austern_mti/std-c++/policy.html ]
[ Comments? mailto:std-c++-request@ncar.ucar.edu                             ]



