From: "Jesper Lund" Newsgroups: comp.os.msdos.djgpp References: <9lor3c$37cki$1 AT reader02 DOT wxs DOT nl> <837kvzg30b DOT fsf AT mercury DOT bitbucket> <9lrk0v$3680a$1 AT reader01 DOT wxs DOT nl> Subject: Re: Q: 2 dimensional array with STL is possible? Lines: 40 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2615.200 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200 Message-ID: <9jgg7.20089$Ay1.277911@news000.worldonline.dk> Date: Tue, 21 Aug 2001 00:36:50 +0200 NNTP-Posting-Host: 212.54.76.170 X-Complaints-To: news-abuse AT wol DOT dk X-Trace: news000.worldonline.dk 998347077 212.54.76.170 (Tue, 21 Aug 2001 00:37:57 MET DST) NNTP-Posting-Date: Tue, 21 Aug 2001 00:37:57 MET DST Organization: Customer of Tiscali A/S (World Online) To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com I can compile _both_ of your examples with my DJGPP 2.95.3 without any errors. Did you remember to include the C++ vector header file with #include If you still have compilation problems, please post the error messages that you get. jansb000 wrote in message news:9lrk0v$3680a$1 AT reader01 DOT wxs DOT nl... > "Nate Eldredge" wrote > > > That seems like it would work, although I don't know for sure. Why > > not try it? > > I did, the compiler seems to accept it, but I got stuck in really using the > 2D array. > > For example (1): > > vector< vector > arint; > arint.resize(20); // gives a list of 20 times vector. > for (int i = 0; i < arint.size(); i++) arint[i].resize(20); // Compiler > complains... > > For example (2): > > vector row; > row.resize(20); > vector< vector > arint; > for (int i = 0; i < 20; i++) arint.push_back(row); // Compiler accepts... > arint[5][4] = 12; // Compiler complains... > > I forgot the exact messages from the compiler. At this point I decided to > first consult the newsgroup before going any further. >