Acces violation of an array[][][][]

Started by
0 comments, last by GameDev.net 17 years, 4 months ago
I'm trying to acces a array short myArray[][][][] with the help of another array short myIndex[][][], in an if conditional, myArray being in a typedef struct myStruct: if(myStruct.array[index[0]][index[1]][index[2]][x]==y){} An goddamn acces violation occurs when the class where the fonction belongs is called.... Arrays limited to 3 colomns in Virtual C++ 6 ?!? My program being a conversion from apple's xcode... Somebody, please, help !! advanced thanx
Advertisement
Quote:Original post by jinuuchukuu
Arrays limited to 3 colomns in Virtual C++ 6 ?!?


Not as far as I know. Though in general I'd recommend just sticking to 1 dimensional arrays and dealing with the row/column layout yourself.

Use the debugger to find out what the values in your indices array are as they are used to index your other array.

The access violation is (probably) caused by you trying to access memory outside the bounds of your array. If your indices are outside the valid range then using them to index the main array will cause an access violation.

This topic is closed to new replies.

Advertisement