The type of the expression must be an array type but it resolved to int

Variable poziceX isn’t an array of int values, but just an int.

Either declare it as an array or choose 1 of poziceXStr[]'s indices to store its current value there:

void tisknuti(final int idx) {
  poziceXStr[idx] = str(poziceX);
}
1 Like