im trying to update values in main according to what changes were made in a function without using pointers
im working on a snake game and to make a move i send the row and column of both the head and the tail to a void function , and inside of it i change them according to what move was made , but they are not updated in main and therefor the next move wont be donr correctly , how can i update them in main but without using pointers ?(its a homework , they specified not using pointers) the code below is for one case which is when the player wants to move down (2 is foe down) and at the end i changed the column of the tail and the row of the head, but it dosent update them in main for when i send the next move
if(move==2){
if (board[head_row+1][head_cal] != 0)
{print_finsih_msg(player,ILLEGAL_MOVE);exit(0);}
if(head_row == tail_row && head_cal < tail_cal) {
board[head_row+1][head_cal] = SHTRODEL_HEAD ;
board[head_row][head_cal] = '+' ;
board[tail_row][tail_cal] = 0;
tail_cal--;
head_row++;}
so for examble if the next move is 6 - right it will print that the move is illegal because it still has that the head has its body on the right