Sign in to follow this  
jinuuchukuu

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

Recommended Posts

jinuuchukuu    166
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

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this