Code: void environment(){ int y; int x; // are both variables, no constants!
// int array[y][x]; // ERROR, because x, y are variables! // declare: const int yMax=40; // 40 or 30 or 50 or sth. else const int xMax=40; // xMax and yMax are constants!
int array[yMax][xMax]; // works fine!
y = TargetY * 2; // where has Targetx/y been declared? x = TargetX * 2;
// and now use only array[0...y][0...x]
} |