Sign in to follow this  

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

This topic is 4022 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

This topic is 4022 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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