Member Avatar

I haven't written any code in a while and I'm trying to refamiliarize myself but I am having trouble.

Im trying to make it so that all the values in an array move down one. Im trying to do that by adding 1 to the value of the pointer that points to the array but im having problems.

this is how I declare the array
int snake[100][3];

and if I try snake++ it doesnt work.

What am I doing wrong?

>>and if I try snake++ it doesnt work
Because snake is not a pointer -- its a 2d array. If you want to move the data from snake[1] to snake[0] you have to move all three integers in each row.

>>What am I doing wrong?
We don't know because you need to post the code you have tried.