There is a array of structures.
static field fields[xsize][ysize];
I want to change it in function
void MoveLeft(pacma
Although arrays and pointers are somewhat interchangeable in C, they're not exactly the same. In particular, an array of arrays and an array of pointers are laid out differently in memory.
Here's a way to make an array of pointers which refers to the same data as your existing array of arrays:
field* field_rows[xsize];
for (unsigned int i=0; i
Then a pointer to that field_rows array can be passed to MoveLeft:
MoveLeft(&Pacman,field_rows,play);
Another solution might be to change the declaration of MoveLeft instead, to take a pointer to array of arrays:
void MoveLeft(pacman *Pacman, field fields[xsize][ysize], int **play);
MoveLeft(&Pacman,fields,play);