Trouble expanding and writing to array of objects

Hello. Thank-you. cellXY is already being set correctly. I just did not include that in my minimal paste.

cell[] c;
int cellAmt = cellRows * cellCols;


void setup() {
  c = new cell[cellAmt];
  int i = 0;
  for (int y = 0; y < cellRows; y++) {
    for (int x = 0; x < cellCols; x++) {
      c[i] = new cell((x * cellSize) + (cellSize /2), (y * cellSize) + (cellSize /2));
      i++;
    }
  }
}


class cell {
    PVector cellXY;

cell(float x, float y) {
    cellXY = new PVector(x, y);
  }

}

And this does give the expected output. I know cellXY is being set.

Also, the cellXY variable in the OP is being used within the cell class where it’s set, so there should be no problem with casting. (setType() is a function within the cell class)