From: "jansb000" Newsgroups: comp.os.msdos.djgpp Subject: Re: Q: 2 dimensional array with STL is possible? Date: Mon, 20 Aug 2001 20:26:49 +0200 Organization: Planet Internet Lines: 28 Message-ID: <9lrk0v$3680a$1@reader01.wxs.nl> References: <9lor3c$37cki$1 AT reader02 DOT wxs DOT nl> <837kvzg30b DOT fsf AT mercury DOT bitbucket> NNTP-Posting-Host: ipc3797b20.dial.wxs.nl X-Trace: reader01.wxs.nl 998331231 3350538 195.121.123.32 (20 Aug 2001 18:13:51 GMT) X-Complaints-To: abuse AT wxs DOT nl NNTP-Posting-Date: 20 Aug 2001 18:13:51 GMT X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com "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.