![]() |
|
#1
|
|||
|
|||
three dimensional arrayi used a three dimensional vector in my program.But while accesing it with [] operator ,i'm living problem.It gives no problem while compiling but when it runned gives a access violation problem.i think after two dimension the use of [] is outbounded.here's my vector:
vector<int> kod; vector<vector<int> > lines; vector<vector<vector<int> > > nums; |
|||
|
#2
|
|||
|
|||
Re: three dimensional arrayQuote:
Two things to remember (but they are really the same thing): 1. The overloaded [] operator does not do bounds checking. 2. You must have the correct sizes of vectors before you can reference the elements with the [] operator. I'll create and initialize a 3-d vector. I do it in stages and I use typdefs to try to keep my sanity, such as it is. CPP / C++ / C Code:
Output: Code:
Regards, Dave Last edited by davekw7x : 02-Mar-2007 at 20:26.
|
Recent GIDBlog
Accepted for Ph.D. program by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Need help deleting the last element in the array | headphone69 | C++ Forum | 2 | 15-Mar-2006 20:31 |
| Pointer Usage in C++: Beginner to Advanced | varunhome | C++ Forum | 0 | 19-Aug-2005 10:25 |
| Dynamic allocation of multi dimensional array | pointer | C Programming Language | 7 | 14-May-2005 00:50 |
| Array 1 dimensional help please asap | lion123 | C Programming Language | 10 | 18-Feb-2005 22:53 |
| template comiling problems - need expert debugger! | crq | C++ Forum | 1 | 01-Feb-2005 22:26 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The